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

  • 相关阅读:
    手机电池mAh和Wh概念
    运行中的iOS应用创建的文件们
    iOS分辨率的那些事儿
    为什么判断UITextField判断为空不能用isEqualToString:@""
    iOS开发里的Bundle是个啥玩意?!
    XCode里的模拟器到底在哪里?我的App被放到哪里了?
    iOS推送消息报错误“Domain=NSCocoaErrorDomain Code=3000”的可能问题
    让你的WordPress支持嵌入ObjectiveC代码
    升级 Mountain Lion 后,svn服务无法使用的解决方法
    对于javascript的词法作用域的思考
  • 原文地址:https://www.cnblogs.com/whiteIcrow/p/9578417.html
Copyright © 2011-2022 走看看