How do you add code to these events for native c++. I couldnt find a WM_LOSTFOCUS OR WM_GOTFOCUS; I only found WM_SETFOCUS. I need code to happen when my window loses focus, and regains it. Thanks
+2
A:
JUST BEFORE your window loses focus it will be sent: WM_KILLFOCUS
AFTER your window gains focus, it will be sent: WM_SETFOCUS
I think I know where the confusion lies. You can send a window a message WM_SETFOCUS
to set it's focus, but you can also get notified when you got focus by adding custom handling for WM_SETFOCUS
and then call the default windows handling.
Brian R. Bondy
2009-09-15 00:58:25