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++;
        }

  • 相关阅读:
    BootstrapBlazor 组件库介绍
    BootstrapBlazor 组件库使用体验---Table篇
    【转载】Bootstrap Blazor 组件介绍 Table (一)自动生成列功能介绍
    【转载】Bootstrap Blazor 组件介绍 Table (二)自定义模板列功能介绍
    【转载】Bootstrap Blazor 组件介绍 Table (三)列数据格式功能介绍
    使用acme.sh从Let's Encrypt申请SSL证书
    Docker一些基本操作
    Nginx配置https以及配置说明
    vi操作
    CentOS 7下安装Docker
  • 原文地址:https://www.cnblogs.com/whiteIcrow/p/9578417.html
Copyright © 2011-2022 走看看