Open chungvinhkhang opened 9 years ago
No but you can get a name of a process with active window somewhere else. e.G.
[DllImport("user32.dll")]
public static extern IntPtr GetWindowThreadProcessId(IntPtr hWnd, out uint ProcessId);
[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow();
string GetActiveProcessFileName()
{
IntPtr hwnd = GetForegroundWindow();
uint pid;
GetWindowThreadProcessId(hwnd, out pid);
Process p = Process.GetProcessById((int)pid);
p.MainModule.FileName.Dump();
}
@chungvinhkhang did you ever find a way to get the id or name of the process that triggered the event?
Hi, Is there param that contains process (id or name) which triggered the events (click, key,..)?