I have a process A, that launches a process B. I load a mouse cursor in A, and I want A to change the mouse cursor when the mouse is on the B window. Is it possible?
I tried to call SetCursor from A when the mouse is over B, but even if I handle the WM_SETCURSOR message in B, the cursor never changes. Am I missing something?
The only way a window can control the mouse when it’s over another window is by capturing the mouse (see SetCapture), or by setting the system mouse, but I very much doubt you want to do the latter.
Unfortunately capturing the mouse means you get all the mouse events sent to your window rather than theirs, so their GUI is unusable.
The only other solution is API hooking and code injection into B where you manage any messages such as WM_MOUSEMOVE and call SetCursor from within the application itself, possibly using some method of interprocess communication to get what cursor to set from application A.