thanks for hleping guys.
@Lolrapa
I dont want to send packages to the client, one may think this is detectable.
@Jo3Bingham
i used the spy++ tool (thanks for the tip), and i've came to this code.
Code:
[DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
public static extern IntPtr PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
static void Main(string[] args)
{
Process notepad = Process.GetProcessesByName("notepad")[0];
const uint WM_KEYDOWN = 0x100;
const uint WM_KEYUP = 0x0101;
const uint F1_KEY = 0x70;
SendMessage(notepad.MainWindowHandle, WM_KEYDOWN, ((IntPtr)F1_KEY), (IntPtr)0);
SendMessage(notepad.MainWindowHandle, WM_KEYUP, ((IntPtr)F1_KEY), (IntPtr)0);
System.Console.ReadLine();
}
What i'm trying to do here, is send a F1 keystroke to notepad, but its not working. Can you give a hint?