日期:2014-05-17 浏览次数:21080 次
[DllImport("user32.dll")]
private static extern void keybd_event(byte bVk, byte bScan, long dwFlags, long dwExtraInfo);
private void button1_Click(object sender, EventArgs e)
{
const byte VK_LWIN = 0x5B;
const byte VK_R = 0x52;
const byte KEYEVENTF_KEYUP = 0x2;
const byte KEYEVENTF_EXTENDEDKEY = 0x1;
keybd_event(VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY, 0);
keybd_event(VK_R, 0, KEYEVENTF_EXTENDEDKEY, 0);
keybd_event(VK_R, 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);
}