The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.
其中,lParam指向WINDOWPOS结构体,这个结构中包含窗口的新信息。所以从以下这句话可以看出:
While this message is being processed, modifying any of the values in WINDOWPOS affects the window's new size, position, or place in the Z order. An application can prevent changes to the window by setting or clearing the appropriate bits in the flags member of WINDOWPOS. 需要改变一个窗口的属性的时候,需要修改这个参数,不能使 用局部的WINDOWPOS
WINDOWPOS* pPos = (LPWINDOWPOS)lParam; 有效
WINDOWPOS pso = (WINDOWPOS)(*lParam); 无效
其中SetWindowPos的参数与WINDOWPOS结构体的参数是一致的
flags 的可取值
SWP_NOSENDCHANGING 的设置并不会阻止窗口对该消息的接收,只是接收的消息中位置相关的参数会清零,并且最后的标志位会是 SWP_NOMOVE | SWP_NOSIZE
hWndInsertAfter
不可以为NULL,必须是窗口句柄或者是HWND_XX的一个参数