I noticed in the DXUT libraries that during servicing WM_L/R/MBUTTONDOWN there is SetCapture(some handle) and during WM_L/R/MBUTTONUP there is ReleaseCapture(). I suspect that this handle is exactly the same as the first parameter in window message procedure. The same is when we simulate minimized the window. Frankly speaking I don't understand what SetCapture and ReleaseCapture might serve in this case and why it is executed. DOes anybody has some assumptions?
SetCapture captures the mouse to a specific window, so that the window keeps getting mouse-messages even if the cursor moves outside its client area, for example WM_MOUSEMOVE and WM_LBUTTONUP. I guess it's used to support dragging within the window for example when rotating a model or moving the camera with the mouse.
If you don't do SetCapture you never get a WM_LBUTTONUP if the mouse moves outside the window before the button is released after a WM_LBUTTONDOWN.
Edited by Erik Rufelt, 28 November 2012 - 03:47 AM.