1

My RegisterHotKey is working perfect:

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)  
.....  

From any application when Grave(`), is pressed the Hot key gets called.

Now, I want to know which application has invoked Grave(`) e.g. WINWORD / NOTEPAD / EXEL etc.

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

always returns 'MyHotKey', the name of my c# program.

Sunil2INR
  • 39
  • 3

0 Answers0