(winapi) mouse hell

Started by
9 comments, last by fir 10 years, 4 months ago


But (at least if you have a fast mouse and a small window) it is quite managale to click with such invisible cursor out of its

parent window (and lost the focus) - i have seen that as far as i remember- this solution gets me quite angry

That is why you use SetCapture. Just read the MSDN documentation for it: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646262%28v=vs.85%29.aspx

You're obviously after code, so here:






case WM_SETFOCUS:
    SetCapture(hwnd);
    break;

EDIT: I think you misunderstand this phrase from MSDN:

SetCapture captures mouse input either when the mouse is over the capturing window, or when the mouse button was pressed while the mouse was over the capturing window and the button is still down.

It does not mean that when your window has the mouse capture you can still click outside the window, and it will lose focus, if this is how you understand it. It means that you can only use SetCapture while the mouse cursor is above your window, or when you click inside your window, but after your window has the mouse captured, all mouse messages are sent to your window, until you call ReleaseCapture or your application loses focus (due to Alt+TAB, for ex.).

Allright tnx for thios info, i overlooked that there is something like

SetCapture I do not used it - This with the previous improvement

probably will improve the thing Need i "unset" capture too is there a way to it?

i am toggling between normal mouse cursor mode and inner

invisible and steereng mouse by pressing mouse wheel so

probably i need setcapture on mouse wheel press eveny uncapture on nexy press.. but will check it later

//edit

ok i see you mention RelaeseCapture - so probably i need to change it on toggling betwin plain mouse cursor and inner mouse and also maybe on set focus lost cocus when in the inner mode - wil check this

This topic is closed to new replies.

Advertisement