public IntPtr Get_Window() { uint threadId = Win32.User32.GetWindowThreadProcessId(IntPtr.Zero, out int processId); Win32.GUITHREADINFO gui = new Win32.GUITHREADINFO(); if (Win32.User32.GetGUIThreadInfo(threadId, gui)) { return(gui.hwndActive); } //return Platform.Win32.User32.GetActiveWindow(); return(IntPtr.Zero); }
public static extern bool GetGUIThreadInfo(UInt32 threadId, [In, Out] GUITHREADINFO pgui);