This is breaking my neck right now. I have two separate windows, window #2 hides and then shows window #1 whenever it detects the mouse has moved in window #2. So, if the mouse stops moving, it should stop doing that.
But instead what I get is an infinite loop. Somehow, the hiding and showing of window #1 ends up triggering the WM_MOUSEMOVE message for window #2. Here's the code: http://codepad.org/U956e2u6 The idea of using mosemove to hide/show a window is from an attempt to simulate menus in some other code, but anyway I can't figure out why MOSEMOVE is retriggered for window #2 all the time even if the mouse is stationary. If you comment out either of the ShowWindow() calls, there will be no infinite loop. I'm hoping someone here has better knowledge than me about WinAPI before I reach for MSDN forums.