BOOL SetWindowPos(
HWND hWnd, // handle to window
HWND hWndInsertAfter, // placement-order handle
int X, // horizontal position
int Y, // vertical position
int cx, // width
int cy, // height
UINT uFlags // window-positioning options
);
如果你把uFlags设置成SWP_NOSIZE 则窗口的大小将保持不变,无论你把cx和cy设置成多少
窗口的大小始终保持不变
至于SWP_SHOWWINDOW 显然是把窗口显示出来啦 呵呵
和SWP_HIDEWINDOW隐藏窗口相反!
楼主 多看看MSDN噢!
这个函数的意思是:The SetWindowPos function changes the size, position, and Z order of a child, pop-up, or top-level window.
过了4级英语的应该可以看懂的噢!
the SetWindowPos function assumes that SWP_NOMOVE and SWP_NOSIZE are set if SWP_HIDEWINDOW or SWP_SHOWWINDOW was set. Thus, hiding and showing a window and changing its size and position are not possible in an atomic operation.