BOOL MoveWindow( HWND hWnd, // handle to window int X, // horizontal position int Y, // vertical position int nWidth, // width int nHeight, // height BOOL bRepaint // repaint option ); Parameters hWnd [in] Handle to the window. X [in] Specifies the new position of the left side of the window. Y [in] Specifies the new position of the top of the window. nWidth [in] Specifies the new width of the window. nHeight [in] Specifies the new height of the window. bRepaint [in] Specifies whether the window is to be repainted. If this parameter is TRUE, the window receives a WM_PAINT message. If the parameter is FALSE, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of moving a child window.
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { cs.hMenu = NULL;//如将hMenu设置为0刚窗口会固定 cs.x=8; cs.y=8; cs.cx=GetSystemMetrics(SM_CXFULLSCREEN); cs.cy=GetSystemMetrics(SM_CYFULLSCREEN)+50; if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return TRUE; }(SM_CYFULLSCREEN)+50;
HWND hWnd, // handle to window
int X, // horizontal position
int Y, // vertical position
int nWidth, // width
int nHeight, // height
BOOL bRepaint // repaint option
);
Parameters
hWnd
[in] Handle to the window.
X
[in] Specifies the new position of the left side of the window.
Y
[in] Specifies the new position of the top of the window.
nWidth
[in] Specifies the new width of the window.
nHeight
[in] Specifies the new height of the window.
bRepaint
[in] Specifies whether the window is to be repainted. If this parameter is TRUE, the window receives a WM_PAINT message. If the parameter is FALSE, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of moving a child window.
{ cs.hMenu = NULL;//如将hMenu设置为0刚窗口会固定
cs.x=8;
cs.y=8;
cs.cx=GetSystemMetrics(SM_CXFULLSCREEN);
cs.cy=GetSystemMetrics(SM_CYFULLSCREEN)+50;
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs return TRUE;
}(SM_CYFULLSCREEN)+50;