WM_CAPTURECHANGED, lParam=0
-
Hi, I am getting WM_CAPTURECHANGED messages with lParam=0 and then my WindowProc stops getting messages (because my focus has disappeared). How is this legal? lParam is supposed to contain the HWND of the window that stole focus away from my WindowProc but it is zero which is an illegal value. How do I find out who has taken focus? Is this documented anywhere? Thank you, Gili
-
Hi, I am getting WM_CAPTURECHANGED messages with lParam=0 and then my WindowProc stops getting messages (because my focus has disappeared). How is this legal? lParam is supposed to contain the HWND of the window that stole focus away from my WindowProc but it is zero which is an illegal value. How do I find out who has taken focus? Is this documented anywhere? Thank you, Gili
-
Don't know if this is documented somwhere but this sounds like Screen Saver attempt at getting the focus before actually going in Screen Saver mode.
-
Hi, I am getting WM_CAPTURECHANGED messages with lParam=0 and then my WindowProc stops getting messages (because my focus has disappeared). How is this legal? lParam is supposed to contain the HWND of the window that stole focus away from my WindowProc but it is zero which is an illegal value. How do I find out who has taken focus? Is this documented anywhere? Thank you, Gili
I think you're getting focus and mouse capture confused. They are not the same thing. To check for a focus change, you'll need to handle
WM_KILLFOCUS
, notWM_CAPTURECHANGED
. Hope this helps,Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
-
I think you're getting focus and mouse capture confused. They are not the same thing. To check for a focus change, you'll need to handle
WM_KILLFOCUS
, notWM_CAPTURECHANGED
. Hope this helps,Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
Sorry, you are right. I believe what is going on is that upon the user clicking and dragging inside the window, WM_CAPTURECHANGED is received indicating that the mouse capture has been released (that's probably what lParam=0 means). The problem, then, is that WM_MOUSEMOVE messages are being posted on the event-queue but my WindowProc never receives them. I am subclassing some other window. My guess is that the window calls GetMessage(), sees WM_MOUSEMOVE, and handles it internally without passing it on to the WindowProc. This poses a problem for me because I absolutely must subclass WM_MOUSEMOVE. Any ideas? Gili
-
Sorry, you are right. I believe what is going on is that upon the user clicking and dragging inside the window, WM_CAPTURECHANGED is received indicating that the mouse capture has been released (that's probably what lParam=0 means). The problem, then, is that WM_MOUSEMOVE messages are being posted on the event-queue but my WindowProc never receives them. I am subclassing some other window. My guess is that the window calls GetMessage(), sees WM_MOUSEMOVE, and handles it internally without passing it on to the WindowProc. This poses a problem for me because I absolutely must subclass WM_MOUSEMOVE. Any ideas? Gili
cowwoc2002 wrote: My guess is that the window calls GetMessage(), sees WM_MOUSEMOVE, and handles it internally without passing it on to the WindowProc. That would be my guess as well. One way to get around this is to install a WH_GETMESSAGE hook, which will get called whenever a message is retrieved from the message queue.
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"