I am trying to redirect mouse inputs in my windows 7 application to another window. If I do this when I get WM_LBUTTONUP, it works (where MouseDown and MouseUp are SendInput functions in Win api):
SetForegroundWindow( other window );
SetCursorPos( somewhere on the window );
MouseDown();
MouseUp();
SetCursorPos( back );
SetForegroundWindow( main window );
But I donโt want to do only mouse releases, I want to be able to capture all mouse elements, including movements and drag and drop.
So, this is the next logical task, but it does not work:
WM_LBUTTONDOWN:
Do everything like before without MouseUp()
WM_LBUTTONUP:
Do everything like before without MouseDown()
This does not work even with regular clicks. I canโt understand why. Can anyone help?
source
share