It is possible to check whenever the X/Y position of the window changed? Also, if it's possible to check if the Window Width/Height changed too.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You're looking for the WM_MOVE
and WM_SIZE
messages.
回答2:
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.