Recently, I searched the Internet for solutions for several cursors and found many possibilities for emulating cursors in this window, for example the MultiPoint SDK , but there are no solutions where you can use several cursors on the entire desktop (and, therefore, not limited to one application).
I almost gave up, thinking that the Windows architecture makes it impossible, but then I found MultiMouse , pointing to this on YouTube, this will at least allow using different cursors for different users on the entire desktop. If this is the case, then it follows that it is possible to emulate several users and thereby make it possible to solve several cursors.
So my questions are:
- Does anyone here use Multimouse and does it really work as described?
- How does it work, can anyone use windows api or do I need to reconfigure Windows for this?
- Do you have ideas on how to draw and control multiple cursors in Windows 7? The problem is that there is only one mouse pointer. Can someone change this, or what do remote applications do? I mean, it would be enough just to show the cursors (globally) and automatically control them.
- I can use any interaction methods, no matter how dirty they are, since it is enough that my application runs only on Windows 7. Does anyone know the Windows libraries that can provide such functionality? Unfortunately, api windows are poorly documented.
Edit:
, Windows, . -, -, , - -. , , Windows:
< 000001 > 00100354 S WM_PARENTNOTIFY fwEvent: WM_LBUTTON xPos: [x] yPos: [y]
< 000002 > 00100354 R WM_PARENTNOTIFY
< 000003 > 001B09D6 S WM_MOUSEACTIVATE hwndTopLevel: 00100354 nHittest: HTCLIENT uMsg: WM_LBUTTONDOWN
< 000004 > 00100354 S WM_MOUSEACTIVATE hwndTopLevel: 00100354 nHittest: HTCLIENT uMsg: WM_LBUTTONDOWN
< 000005 > 00100354 R WM_MOUSEACTIVATE fuActivate: MA_ACTIVATE
< 000006 > 001B09D6 R WM_MOUSEACTIVATE fuActivate: MA_ACTIVATE
< 000007 > 001B09D6 P WM_LBUTTONDOWN fwKeys: MK_LBUTTON xPos: [x] yPos: [y]
< 000008 > 001B09D6 P WM_LBUTTONUP fwKeys: 0000 xPos: [x] yPos: [y]
00100354 , 001B09D6 (Flash-). , ([x], [y]). , Windows, , . 00100354, . , , < 000007 > < 000008 > , , , . , . , , , . , , (0,0) .
, , Win32, :
[DllImport("User32.dll", SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr hWnd, WM Msg, IntPtr wParam, IntPtr lParam);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("user32.dll", SetLastError = true)]
public static extern bool PostMessage(IntPtr hWnd, WM Msg, IntPtr wParam, IntPtr lParam);
[...]
public static IntPtr ToWMCoords(Point pt)
{
return (IntPtr)(((uint)pt.Y << 16) | (ushort)pt.X);
}
[...]
foreach (Point pt in coordinates)
{
Console.Write("Message-Clicking at " + pt + "\n");
IntPtr mousePos = ToWMCoords(pt);
IntPtr flashHwnd = Interop.GetChildWindows(hwnd).Where(x => Interop.GetClassNameOfHandle(x) == "MacromediaFlashPlayerActiveX").Single();
Interop.User32.SendMessage(hwnd, Interop.WM.PARENTNOTIFY, (IntPtr)0x201, mousePos);
Interop.User32.SendMessage(flashHwnd, Interop.WM.MOUSEACTIVATE, hWnd, (IntPtr)0x2010001);
Interop.User32.SendMessage(hwnd, Interop.WM.MOUSEACTIVATE, hWnd, (IntPtr)0x2010001);
bool lBtnDown = Interop.User32.PostMessage(flashHwnd, Interop.WM.LBUTTONDOWN, (IntPtr)Interop.MK.LBUTTON, mousePos);
bool lBtnUp = Interop.User32.PostMessage(flashHwnd, Interop.WM.LBUTTONUP, IntPtr.Zero, mousePos);
Console.Write("WM_LBUTTONDOWN " + (lBtnDown ? "success" : "fail") + ", WM_LBUTTONUP " + (lBtnDown ? "success" : "fail") + "\n");
}
, , .