示例#1
0
        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);
        }
示例#2
0
        public static string GetTextOfForegroundWindow()
        {
            IntPtr hwnd = WinAPIDeclarations.GetForegroundWindow();

            return(GetTextOfWindow(hwnd));
        }
示例#3
0
        // ---------------

        public static IntPtr GetForegroundWindowId()
        {
            return(WinAPIDeclarations.GetForegroundWindow());
        }