Skip to main content
gamedev.net
🔒 Locked

Question about SetCapture...

Started by Drunken_Monkey 1 reply 1k views
Original Post
Drunken_Monkey
Drunken_Monkey
SetCapture will continue to send mouse messages to a window when a mouse button is held down in the window and the cursor leaves the window. Is there a way to continue sending mouse messages to captured window when the cursor leaves it, without pressing the button down first? Also, whenever I use SetCapture, the mouse turns into the loading sign through the entire program and that's bugging the hell out of me. Is there something I can do about that? [Edited by - Drunken_Monkey on January 3, 2007 10:10:50 AM]
JY
JY
SetCapture doesn't have to be called in response to clicking the mouse button. I call SetCapture in response to WM_MOUSEMOVE to capture the mouse immediately. Use GetCapture to make sure you don't already have capture.

Then, if you want to, when the mouse is outside the window you can release the capture.

I'm not sure about the cursor though, this doesn't happen for me. You should probably try setting the cursor in response to WM_SETCURSOR - there are articles on MSDN about this, sorry I don't have a link.
"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
Drunken_Monkey
Drunken_Monkey
Quote:
Original post by JY
I call SetCapture in response to WM_MOUSEMOVE to capture the mouse immediately.


That solved both of my problems, thanks for posting. :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.