1

我的 RegisterHotKey 运行良好:

bool Bnk = Form1.RegisterHotKey(this.Handle, this.GetType().GetHashCode(), 0x0000, 0xC0);  
....  
[DllImport("user32.dll")]  
public static extern bool RegisterHotKey(IntPtr hWnd, int id,    int fsModifiers, int vlc);  
protected override void WndProc(ref Message m)  
.....  

从任何应用程序中,当按下 Grave(`) 时,都会调用热键。

现在,我想知道哪个应用程序调用了 Grave(`) 例如 WINWORD / NOTEPAD / EXEL 等。

string CallingProcess = Process.GetCurrentProcess().ToString();
MessageBox.Show(CallingProcess);

总是返回 'MyHotKey',我的 c# 程序的名称。

4

0 回答 0