Пример #1
0
        private static void clickErrorButton()
        {
            while (true)
            {
                IntPtr hwndStart  = Win32Pinvoker.FindWindow(DIALOG_CLASSNAME, "Adobe Illustrator");
                IntPtr hwndStart2 = Win32Pinvoker.FindWindow(DIALOG_CLASSNAME, "Text Import Options");

                if (hwndStart == IntPtr.Zero && hwndStart2 == IntPtr.Zero)
                {
                    Thread.Sleep(3000);
                }
                else
                {
                    IntPtr hwnd2 = Win32Pinvoker.FindWindowEx(hwndStart, IntPtr.Zero, "Button", "OK");
                    IntPtr hwnd3 = Win32Pinvoker.FindWindowEx(hwndStart2, IntPtr.Zero, "Button", "OK");
                    if (hwnd2 != IntPtr.Zero)
                    {
                        Win32Pinvoker.ClosePopupDialog(hwnd2);
                    }
                    if (hwnd3 != IntPtr.Zero)
                    {
                        Win32Pinvoker.ClosePopupDialog(hwnd3);
                    }
                }
            }
        }
Пример #2
0
        private static void clickErrorButton()
        {
            while (true)
            {
                IntPtr hwndStart1 = Win32Pinvoker.FindWindow(DIALOG_CLASSNAME, "Adobe Illustrator");
                IntPtr hwndStart2 = Win32Pinvoker.FindWindow(DIALOG_CLASSNAME, "Text Import Options");
                IntPtr hwndStart3 = Win32Pinvoker.FindWindow(DIALOG_CLASSNAME, "");
                IntPtr hwndStart4 = Win32Pinvoker.FindWindow(DIALOG_CLASSNAME, "Font Problems");

                if (hwndStart1 == IntPtr.Zero && hwndStart4 == IntPtr.Zero && hwndStart2 == IntPtr.Zero)
                {
                    Thread.Sleep(500);
                }
                if (hwndStart3 == IntPtr.Zero)
                {
                    Thread.Sleep(100);
                }

                else
                {
                    IntPtr hwnd2 = Win32Pinvoker.FindWindowEx(hwndStart1, IntPtr.Zero, "Button", "OK");
                    IntPtr hwnd3 = Win32Pinvoker.FindWindowEx(hwndStart2, IntPtr.Zero, "Button", "OK");
                    IntPtr hwnd4 = Win32Pinvoker.FindWindowEx(hwndStart3, IntPtr.Zero, "Button", "&Ignore");
                    IntPtr hwnd5 = Win32Pinvoker.FindWindowEx(hwndStart4, IntPtr.Zero, "Button", "Open");

                    if (hwnd2 != IntPtr.Zero)
                    {
                        Win32Pinvoker.ClosePopupDialog(hwnd2);
                    }
                    if (hwnd3 != IntPtr.Zero)
                    {
                        Win32Pinvoker.ClosePopupDialog(hwnd3);
                    }
                    if (hwnd4 != IntPtr.Zero)
                    {
                        Win32Pinvoker.ClosePopupDialog(hwnd4);
                    }
                    if (hwnd5 != IntPtr.Zero)
                    {
                        Win32Pinvoker.ClosePopupDialog(hwnd5);
                    }
                }
            }
        }
Пример #3
0
 private static void clickButton()
 {
     while (started)
     {
         IntPtr hwnd = Win32Pinvoker.FindWindow(DIALOG_CLASSNAME, DIALOG_TITLE);
         if (hwnd == IntPtr.Zero)
         {
             Thread.Sleep(2000);
         }
         else
         {
             IntPtr hwnd1 = Win32Pinvoker.FindWindowEx(hwnd, IntPtr.Zero, "Button", "Launch");
             if (hwnd1 != IntPtr.Zero)
             {
                 Win32Pinvoker.ClosePopupDialog(hwnd1);
             }
         }
     }
 }