110,477
社区成员
发帖
与我相关
我的任务
分享
Process[] thisproc = Process.GetProcessesByName("SendKeysForm");
thisproc[0].StartInfo.WindowStyle = ProcessWindowStyle.Normal;
SendKeys.SendWait("^+%(P)");
public Form1()
{
RegisterHotKey(Handle, 500,7, Keys.P);
}
[System.Runtime.InteropServices.DllImport("user32.dll")] //申明API函数
public static extern bool RegisterHotKey(
IntPtr hWnd, // handle to window
int id, // hot key identifier
uint fsModifiers, // key-modifier options
Keys vk // virtual-key code
);
public enum KeyModifiers
{
None = 0,
Alt = 1,
Control = 2,
Shift = 4,
Windows = 8
}