Any working key macro up ?
public static void SendSpace(IntPtr hWnd)
{
PostMessage(hWnd, (IntPtr)WindowsMessage.WM_KEYDOWN, (IntPtr)0x20, (IntPtr)0x390001);
PostMessage(hWnd, (IntPtr)WindowsMessage.WM_CHAR, (IntPtr)0x20, (IntPtr)0x390001);
PostMessage(hWnd, (IntPtr)WindowsMessage.WM_KEYUP, (IntPtr)0x20, (IntPtr)0xC0390001);
}
public static void RightMouseClickRelative(IntPtr hWnd, int relativX, int relativY)
{
PostMessage(hWnd, (IntPtr)WindowsMessage.WM_RBUTTONDOWN, (IntPtr)HitTestValues.HTCLIENT, (IntPtr)((relativY << 16) | relativX));
PostMessage(hWnd, (IntPtr)WindowsMessage.WM_RBUTTONUP, (IntPtr)HitTestValues.HTNOWHERE, (IntPtr)((relativY << 16) | relativX));
}
PostMessage is not working for me. It works on notepad, but not on KalOnline. I took your RightMouseClickRelative function. What could be the problem?Quote:
PostMessage: [Only registered and activated users can see links. Click Here To Register...]
You can simulate mouse presses and key presses with it. And it will work background too which is awesome as well. The Function Parameters you can get with spy++ easily (this program is self explanory trust me)
Example code for sending Space button (c#)
Example code for sending right mouse click relative to the top left point of the KalOnline Window (c#)Code:public static void SendSpace(IntPtr hWnd) { PostMessage(hWnd, (IntPtr)WindowsMessage.WM_KEYDOWN, (IntPtr)0x20, (IntPtr)0x390001); PostMessage(hWnd, (IntPtr)WindowsMessage.WM_CHAR, (IntPtr)0x20, (IntPtr)0x390001); PostMessage(hWnd, (IntPtr)WindowsMessage.WM_KEYUP, (IntPtr)0x20, (IntPtr)0xC0390001); }
Have funCode:public static void RightMouseClickRelative(IntPtr hWnd, int relativX, int relativY) { PostMessage(hWnd, (IntPtr)WindowsMessage.WM_RBUTTONDOWN, (IntPtr)HitTestValues.HTCLIENT, (IntPtr)((relativY << 16) | relativX)); PostMessage(hWnd, (IntPtr)WindowsMessage.WM_RBUTTONUP, (IntPtr)HitTestValues.HTNOWHERE, (IntPtr)((relativY << 16) | relativX)); }
Same think happended to me too when I tested and I was confused too. For me case 1 helped.Quote:
PostMessage is not working for me. It works on notepad, but not on KalOnline. I took your RightMouseClickRelative function. What could be the problem?