I am attempting to create a program that would allow you to plug two keyboards and mice into a single computer and play two copies of WoW at the same time by splitting their inputs to the different application windows. I found no good tool for this online, so I'm making my own.
From all my research and testing it seems like SendMessage and PostMessage are my best bet. I've been intercepting WM_INPUT messages on windows and sending them to the desired application and so far this has been working... to an extent.
I've tested my application with an older RTS game called Command and Conquer Generals and it worked perfectly. I superimposed a dummy mouse cursor over the game and was able to scroll around and click as if it were the real mouse. This isn't working with WoW's client, however. And I believe it to be some anti-cheat bullshittery built within the client itself.
I have two videos to help you understand the problem I'm experiencing:
The first simply shows my program working as I would expect when sending input to Chrome. As I scroll around and click you can see Chrome reacting to the superimposed cursor as if I were scrolling right over it.
Video 1: Nice
This second video shows me doing the exact same thing with WoW's client, and for some reason it does not quite work right. It just plain doesn't work with the dummy cursor, but it does respond to the *real* cursor, even though the window technically doesn't have focus (which tells me that PostMessage is working, but it just refuses to acknowledge the clicks at the location of the dummy cursor instead of the real cursor).
Video 2: Not Quite
So my question is simple: does anyone have any experience directly sending mouse input to WoW's client in this way? I'm certain it's some level of anti-cheat protection but I'm not sure how to get around it.
To give an example of my code for handling mouse click events, here you go:
Code:
private void m_MouseButtonDown(object sender, InputDevice.MouseControlEventArgs e)
{
if (e.Mouse.deviceHandle != MouseHandle1)
return;
uint L_Param_Window = (uint)(cursorPosX + ((int)cursorPosY << 16));
uint W_Param = 0;
switch (e.Mouse.buttonMessage)
{
case WM_LBUTTONDOWN:
W_Param = (uint)MouseButtons.LEFT;
break;
case WM_MBUTTONDOWN:
W_Param = (uint)MouseButtons.MIDDLE;
break;
case WM_RBUTTONDOWN:
W_Param = (uint)MouseButtons.RIGHT;
break;
}
// Send Messages
PostMessage(applicationHandle1, e.Mouse.buttonMessage, (IntPtr)W_Param, (IntPtr)L_Param_Window);
}
I have tried ensuring the input mapper has administrator privileges, and I have tried toggling on/off the "Hardware Cursor" setting in WoW.
This is done in C#, by the way.
Thank you in advance.