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

  • 相关阅读:
    alert
    自定义基类装载数据模块显示到dataGrid
    关于dataGrid查询按钮的实现
    如何查看oracle用户具有的权限和角色 大风起
    LoadRunner使用手册 大风起
    电脑蓝屏了,教你一招保证恢复 大风起
    oracle如何查看当前有哪些用户连接到数据库 大风起
    apache+tomcat整合(动静分离) 大风起
    cdn技术浅谈 大风起
    Tomcat性能优化总结 大风起
  • 原文地址:https://www.cnblogs.com/whiteIcrow/p/9578417.html
Copyright © 2020-2023  润新知