读书人

请教在SetWindowPos()的最后写的参数是

发布时间: 2012-02-16 21:30:36 作者: rapoo

请问在SetWindowPos()的最后写的参数是:SWP_NOSIZE || SWP_SHOWWINDOW,什么意思?
rt

[解决办法]
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.
[解决办法]
MSDN里的原话是这样的:

SWP_NOSIZE Retains the current size (ignores the cx and cy parameters).

SWP_SHOWWINDOW Displays the window.

建议楼主多看看MSDN哦!

[解决办法]
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级英语的应该可以看懂的噢!

读书人网 >VC/MFC

热点推荐