how to use RegisterHotKey() in C#? [duplicate]
问题 This question already has an answer here: Global hotkey in console application 4 answers I'm trying register a hot key, I'm translating this C++ code,I wrote it: using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace ConsoleApplication1 { class Program { [DllImport("user32.dll")] public static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, int vk); [DllImport("user32")] public static extern bool GetMessage(ref