private static uint GetForegroundWindowProcessID() { uint pid; IntPtr fwin = WinAPIDeclarations.GetForegroundWindow(); uint idCreatorThread = WinAPIDeclarations.GetWindowThreadProcessId(fwin, out pid); // identifier of the thread that created the window return(pid); }
public static string GetTextOfForegroundWindow() { IntPtr hwnd = WinAPIDeclarations.GetForegroundWindow(); return(GetTextOfWindow(hwnd)); }
// --------------- public static IntPtr GetForegroundWindowId() { return(WinAPIDeclarations.GetForegroundWindow()); }