Small problem with SetCaputure() in a CView (SDI)
Hello to all.
I am developing a small mouse movement detector. It is an SDI app that does some stuff only based on mouse movement, regardless form its position or button flag.
To do so, I tried to enable mouse capturing on left button, to send all mouse movement messages to my CView to monitorate them until right button is pressed.
Anyway, unfortunately, mouse movement is captured only inside CView and its window border, title and toolbar. I'd need messages to be conveyed to my MyCView::OnMouseMove(...) function.
I thank you all for any help
Re: Small problem with SetCaputure() in a CView (SDI)
Try SetWindowsHookEx function with WH_MOUSE_LL parameter. You can have any information about the mouse in the hook callback, both when mouse input belongs to your application or not.
Regarding SetCapture, it can be set when your application owns the mouse input, and valid until mouse button is pressed. If it doesn't work, post some code.
Re: Small problem with SetCaputure() in a CView (SDI)
I understand. I didn't know SetCapture() works only if mouse button is pressed. I thing in Dialog boxes it works anyway, but CView, being a different, more complex "window structure", works differently.
Thanks for the info on how to get mouse in any window... It will be very very useful.