Hello, I have recently started to toy around with the idea of sending a mouse click, or other events, to a conquer client that is minimized, or just not in focus. I have been using Spy++ to help along in all the messages the client receives and what not. I have got it kind of working and was wondering if anyone here could give me a hand.
This is what I have so far, I haven't worried about finding the hWnd of any of the necessary windows yet because I don't want to spend the time if it doesn't work. So basically I open the client then my windows form and click the button. I have the simulated mouse click click the "enter" button so there is a pop up. If I send the messages multiple times rapidly the button gets clicked. When I don't send it rapidly you can just see the enter button get highlighted so I know the SETCURSOR and MOUSEMOVE messages are moving.
I'm not sure if anyone has messed with this before, and actually got it working, but the other threads I have found didn't provide any good information. Any help appreciated.
Edit: So I still have not figured it out but I logged in and did a mouse click in game and it works. Would still be interested in if anyone has a reason why the above code only works when its sent repeatedly. thanks.
Thanks
Code:
//WM_PARENTNOTIFY-SendMessage-ParentWindow bool seven = MouseClickHandler.SendMessage(new IntPtr(0x004F04CA), (int)0x0210, new IntPtr(0x00000201), new IntPtr(MouseClickHandler.getHiLoWord(730, 719))); //WM_SETCURSOR-Sendmessage-"Macromdia" window bool two = MouseClickHandler.SendMessage(new IntPtr(0x00140210), (int)0x0020, new IntPtr(0x00140210), new IntPtr(0x02000001)); //WM_MOUSEMOVE-PostMessage-"Macromedia" window bool four = MouseClickHandler.PostMessage(new IntPtr(0x00140210), (uint)0x200, IntPtr.Zero, new IntPtr(MouseClickHandler.getHiLoWord(730, 719))); //WM_MOUSEACTIVATE-SendMessage-"Macromedia" window bool one = MouseClickHandler.SendMessage(new IntPtr(0x00140210), (int)0x021, new IntPtr(0x004F04CA), new IntPtr(0x02010001)); //WM_LBUTTONDOWN-PostMessage-"Macromedia" window bool three = MouseClickHandler.PostMessage(new IntPtr(0x00140210), (uint)0x201, new IntPtr(0x00000001), new IntPtr(MouseClickHandler.getHiLoWord(730, 719))); //WM_MOUSEMOVE-PostMessage-"Macromedia" window bool six = MouseClickHandler.PostMessage(new IntPtr(0x00140210), (uint)0x200, new IntPtr(0x00000001), new IntPtr(MouseClickHandler.getHiLoWord(730, 719))); //WM_LBUTTONUP-PostMessage-"Macromedia" window bool five = MouseClickHandler.PostMessage(new IntPtr(0x00140210), (uint)0x202, IntPtr.Zero, new IntPtr(MouseClickHandler.getHiLoWord(730, 719)));
I'm not sure if anyone has messed with this before, and actually got it working, but the other threads I have found didn't provide any good information. Any help appreciated.
Edit: So I still have not figured it out but I logged in and did a mouse click in game and it works. Would still be interested in if anyone has a reason why the above code only works when its sent repeatedly. thanks.
Thanks