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);
                    }
                }
            }
        }
 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);
             }
         }
     }
 }