-1

是否可以检查窗口的 X/Y 位置何时发生变化?此外,是否可以检查窗口宽度/高度是否也发生了变化。

4

2 回答 2

2

您正在寻找WM_MOVEWM_SIZE消息。

于 2012-07-29T23:07:40.160 回答
1

As already answered, you can handle WM_SIZE and WM_MOVE. But you can also intercept the messages before they have any effect by checking WM_WINDOWPOSCHANGING (except in the case where a call to SetWindowPos passes SWP_NOSENDCHANGING - but that is usually deliberate and completely under your control). This message is useful for cleanly handling window size/position restrictions or doing window snapping. If you force stuff to happen during WM_SIZE or WM_MOVE you will get flickering etc.

于 2012-07-29T23:58:56.837 回答