edit: sorry, the title was supposed to be double WM_ACTIVATEAPP rather than double WM_ACTIVATE, but my application is getting two of both so I guess it doesn't matter much.
I'm having some issues trying to maintain the window focus state for my game engine. While messing around with debugging today, I noticed that I'm receiving two WM_ACTIVATEAPP messages when I click the windows task bar to minimize my game's (non-full-screen) windowed application.
The first message looks correct, with w_param being false. But then, immediately after, I get another copy of that same message, with w_param set to true. This makes my app think its focused throughout the time it's minimized. And when I click my application in the taskbar to re-focus it, windows doesn't send a WM_ACTIVATEAPP at all - I'm assuming because it already believes my app is focused.
I've googled this to death, and I've found several people posting about the same issue (such as http://forums.indiegamer.com/showthread.php?2058-Getting-two-WM_ACTIVATEAPP-messages), but no one posting any type of solution. edit: After testing, I've found that I also get two WM_ACTIVATE messages as well.
Has anyone found a solution to this? Or perhaps someone else is aware of what I may be doing wrong to cause it? Such as calling some focus-like function, which is forcing my window to regain focus?
Thanks for any advice
edit: when I click the task bar of my window, the flow of related messages goes..
+ WM_ACTIVATE=0
+ WM_ACTIVATEAPP=0
+ KILLFOCUS
+ ACTIVATEAPP=1
+ ACTIVATE=1