예제 #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());
        }