Jump to content
  • Advertisement
Sign in to follow this  
anders211

SetCapture and ReleaseCapture during pressing button, minimizing window?

This topic is 2057 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!