As title says everything clear. I want to open this menu via my Windows Application. Thanks.
Asked
Active
Viewed 39 times
2

ΦXocę 웃 Пepeúpa ツ
- 47,427
- 17
- 69
- 97

Dicaste
- 31
- 5
-
http://stackoverflow.com/a/6407690/440030 – Reza ArabQaeni Feb 21 '16 at 19:26
2 Answers
1
Use the following code:
private void button1_Click(object sender, EventArgs e)
{
KeyDown(ConsoleKey.LeftWindows);
KeyDown(ConsoleKey.P);
KeyUp(ConsoleKey.LeftWindows);
KeyUp(ConsoleKey.P);
}
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
private const int KEYEVENTF_EXTENDEDKEY = 1;
private const int KEYEVENTF_KEYUP = 2;
public static void KeyDown(ConsoleKey vKey)
{
keybd_event((byte)vKey, 0, KEYEVENTF_EXTENDEDKEY, 0);
}
public static void KeyUp(ConsoleKey vKey)
{
keybd_event((byte)vKey, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
}

Nathan
- 541
- 1
- 4
- 20
0