非摸态对话框开始显示的时候总是在框架的左上角位置,怎么才能改变显示时的位置?

解决方案 »

  1.   

    void MoveWindow( int x, int y, int nWidth, int nHeight, BOOL bRepaint = TRUE );void MoveWindow( LPCRECT lpRect, BOOL bRepaint = TRUE );ParametersxSpecifies the new position of the left side of the CWnd.ySpecifies the new position of the top of the CWnd.nWidthSpecifies the new width of the CWnd.nHeightSpecifies the new height of the CWnd.bRepaintSpecifies whether CWnd is to be repainted. If TRUE, CWnd receives aWM_PAINT message in its OnPaint message handler as usual. If this parameter is FALSE, no repainting of any kind occurs. This applies to the client area, to the nonclient area (including the title and scroll bars), and to any part of the parent window uncovered as a result of Cwnd’s move. When this parameter is FALSE, the application must explicitly invalidate or redraw any parts of CWnd and parent window that must be redrawn.lpRectThe CRect object or RECT structure that specifies the new size and position.添加在OnInitDialog()中
      

  2.   

    例如:CRect rect;rect.left = 12;
    rect.top = 20;
    rect.right = 300;
    rect.button = 400;MoveWindow(rect);