Alter mouse coordinates in LowLevelMouseProc not working


2004-07-30 05:41:47 PM
cppbuilder97
Hi
Thanks for taking the time to read this.
I've installed a WH_MOUSE_LL hook proc that's designed to simulate a
multi-screen desktop.
When the mouse reaches the right hand edge of my screen, I want to
wrap the mouse back to the left side, hide the mouse and network the
mouse data to a remote pc, where it is injected - thus making the
screens look like they're controlled by a single mouse.
My mouse proc is installed into the message chain correctly, using
SetWindowsHookEx. I correctly detect when the mouse reaches the far
right-hand edge of the screen. Once here, I set the X-coordinate to 0,
and call SetCursorPos to alter the coordinates.
The mouse jumps to the left hand edge of the screen, but now will not
go any further right. Inspecting the coordinates I am putting onto my
queue for networking to the remote pc, the X-coordinates climb, but
are pulled back to the original coordinate that I set them to with
SetCursorPos.
Has anyone experienced this behaviour? I am returing -1 from my mouse
hook proc when I wrap the coordinates because I don't want windows to
process the mouse any further. Could this be affecting things?
Thanks for your help!
Regards
Steve