The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Scorpie on June 10, 2006, 09:44:10 PM

Title: [Hooks] Moving window
Post by: Scorpie on June 10, 2006, 09:44:10 PM
Ok here is the problem, I'm trying to hook a window (which is no problem) and want to react whenever the window moves.
A normal hook doesn't cover the WM_MOVE message so that's no use. I've tried the HCBT hook, this covers the move event but only gives you a message (HCBT_MOVESIZE) when the window is done moving, i want an event whenever the window moves (so at every pixel it moves), no matter if the mouse is released in between etc etc.
Anyone has any idea on how to do this?

Sincerely,

Scorpie
Title: Re: [Hooks] Moving window
Post by: jdoe on June 10, 2006, 11:22:22 PM

I think you are searching for the WM_WINDOWPOSCHANGED notification.

Using SetWindowLong with GWL_WNDPROC flag to set a custom WindowProc should help you to get this notification.


:U

Title: Re: [Hooks] Moving window
Post by: Scorpie on June 11, 2006, 11:26:00 AM
Thanks for the reply,

when i set my own WindowProc, is there a way to let it also use the default? Because the program wouldn't function properly anymore i think?
Edit: Guess i need to read the subclassing tutorial from iczelion right? (found that somewhere on the board, had about the same problem)

More edit: Woohoo its working now, thanks  :U