Пример #1
0
        private static IntPtr GetFocusWindow()
        {
            var guiThreadInfo = new Win32.GUITHREADINFO();

            if (!Win32.GetGUIThreadInfo(0, guiThreadInfo))
            {
                throw new Win32Exception(Marshal.GetLastWin32Error());
            }
            return(guiThreadInfo.hwndFocus);
        }
Пример #2
0
        private static IntPtr GetFocusWindow()
        {
            var guiThreadInfo = new Win32.GUITHREADINFO();

            if (!Win32.GetGUIThreadInfo(0, guiThreadInfo))
            {
                var except = Marshal.GetLastWin32Error();
                throw new Win32Exception(except);
            }
            return(Win32.GetAncestor(guiThreadInfo.hwndFocus, Win32.GA_ROOT));
        }
Пример #3
0
 private static IntPtr GetFocusWindow()
 {
     var guiThreadInfo = new Win32.GUITHREADINFO();
     if (!Win32.GetGUIThreadInfo(0, guiThreadInfo))
         throw new Win32Exception(Marshal.GetLastWin32Error());
     return guiThreadInfo.hwndFocus;
 }