示例#1
0
        public static IntPtr win32_Desktop_Window_With_Title(this string title, bool waitForWindow = true)
        {
            var wait_Count = 10;
            var wait_Value = 1000;
            var window     = Win32_Window.FindWindowsWithText(title).first();

            if (window != default(IntPtr))
            {
                return(window);
            }
            if (waitForWindow)
            {
                for (var i = 0; i < wait_Count; i++)
                {
                    window = Win32_Window.FindWindowsWithText(title).first();
                    if (window != default(IntPtr))
                    {
                        return(window);
                    }
                    wait_Value.sleep();
                }
            }
            return(default(IntPtr));
        }
示例#2
0
 public static bool win32_CloseWindow(this IntPtr hWnd)
 {
     return(Win32_Window.CloseWindow(hWnd));
 }