zoukankan      html  css  js  c++  java
  • RiseDialog

    C++

    void CNXOper::ResetSize()
    {
     HWND hWnd = GetActiveWindow();
     CWnd *pCWnd = CWnd::FromHandle(hWnd);
     //该函数返回指定窗口的边框矩形的尺寸。该尺寸以相对于屏幕坐标左上角的屏幕坐标给出
     RECT oldRect;
     pCWnd->GetWindowRect(&oldRect);
     POINT screenSys;
     screenSys.x =  = oldRect.left;
     s;
     screenSys.y =  = oldRect.top;
     R;
     RECT parentRect;
     HWND parentIntPtr = (HWND)UF_UI_get_default_parent();
     if (NULL == parentIntPtr || parentIntPtr == pCWnd->m_hWnd)
      return;
     GetWindowRect(parentIntPtr, &parentRect);
     int X_LEN =  = parentRect.right - p -  - parentRect.left;
     i;
     int Y_LEN =  = parentRect.bottom - p -  - parentRect.top;
     R;
     RECT rect;
     ;
     rect.left = s = screenSys.x;
     ;
     rect.right = s = screenSys.x + (X_LEN / 6 * 2);
     ;
     rect.bottom = s = screenSys.y + (Y_LEN / 6 * 5);
     ;
     rect.top = s = screenSys.y;
     //相对于屏幕坐标
     pCWnd->MoveWindow(&rect, false);
    }

    C#

    private void ResetSize()
        {
            if (isResetFlag == 50)//要等50个控件都显示完毕后再进行移动重绘
            {
                IntPtr hWnd = ApiMethod.GetActiveWindow();
                System.Drawing.Rectangle oldRect = new Rectangle();
                //该函数返回指定窗口的边框矩形的尺寸。该尺寸以相对于屏幕坐标左上角的屏幕坐标给出
                ApiMethod.GetWindowRect(hWnd, ref oldRect);
                IntPtr parentIntPtr = NXOpenUI.FormUtilities.GetDefaultParentWindowHandle();
                if (hWnd == parentIntPtr)
                    return;
                System.Drawing.Rectangle parentRect = new Rectangle();
                ApiMethod.GetWindowRect(parentIntPtr, ref parentRect);
                //同一个对象先调用GetWindowRect后再调用ScreenToClient,这个时候得到的rect和直接使用GetClientRect得到的值相等
                System.Drawing.Point screenSys = new System.Drawing.Point();
                // screenSys.X = oldRect.Left;
                screenSys.X = oldRect.Left;
                screenSys.Y = oldRect.Top;
                ApiMethod.ScreenToClient(parentIntPtr, ref screenSys);
                screenSys.X = 0;           
                int X_LEN = parentRect.Right - parentRect.Left;
                int Y_LEN = parentRect.Bottom - parentRect.Top;
                width = (X_LEN / 10) * 4;
                int wizard_W = (Y_LEN / 8) * 7;
                ApiMethod.ClientToScreen(parentIntPtr, ref screenSys);
                ApiMethod.MoveWindow(hWnd, screenSys.X, screenSys.Y, width, wizard_W, false);
            }
            isResetFlag++;
        }

  • 相关阅读:
    [Xcode 实际操作]八、网络与多线程-(16)使用网址会话对象URLSession下载图片并显示下载进度
    [Xcode 实际操作]八、网络与多线程-(15)使用网址会话对象URLSession下载图片并存储在沙箱目录中
    leetcode第一刷_Best Time to Buy and Sell Stock II
    Unity 武器拖尾效果
    Android环境搭建 NDK+ADT(免cywgin)
    ros下单目相机校正
    Valid Phone Numbers
    ExtJS4.2.1与Spring MVC实现Session超时控制
    Kafka具体解释二、怎样配置Kafka集群
    OutOfMemoryError: Java heap space和GC overhead limit exceeded在Ant的Build.xml中的通用解决方式
  • 原文地址:https://www.cnblogs.com/whiteIcrow/p/9578417.html
Copyright © 2011-2022 走看看