我有这个code:
public static void Next()
{
Process[] processes = Process.GetProcessesByName("test");
foreach (Process proc in processes)
PostMessage(proc.MainWindowHandle, WM_KEYDOWN, VK_RIGHT, 0);
}
这code货物内右箭头键,我想送ALT + CTRL +右键我想这样的:
This code sents the Right Arrow key, i want to sent ALT+CTRL+RIGHT i tried this:
public static void Forward()
{
Process[] processes = Process.GetProcessesByName("test");
foreach (Process proc in processes)
{
PostMessage(proc.MainWindowHandle, WM_KEYDOWN, VK_CONTROL, 0);
PostMessage(proc.MainWindowHandle, WM_KEYDOWN, VK_ALT, 0);
PostMessage(proc.MainWindowHandle, WM_KEYDOWN, VK_RIGHT, 0);
}
}
不过,这并不工作...
But it doesn't work...
任何想法?
的你不能模拟键盘输入于PostMessage 的,至少不能可靠地使用 SendInput 的吧。
You can't simulate keyboard input with PostMessage, at least not reliably use SendInput instead.