static void Main(string[] args) { tempfile = Path.Combine(Path.GetTempPath(), "tmp.mdlink"); var f = new LauncherX.ServerSelector(); var g = new Start.PleaseWait(); g.Hide(); LauncherX.ServerSelector.w = g; System.Windows.Forms.Application.Run(f); System.Windows.Forms.Application.Exit(); }
void WaitCheckLaunch() { int CycleCount = 0; while (rect.Width == 0 || wnd == IntPtr.Zero) { Thread.Sleep(100); if (rect.Width > 0 && wnd != IntPtr.Zero) { break; } else { CycleCount++; if (CycleCount > CycleTimeout) { throw new Exception("Launching of WoM timed out after 10 seconds"); } if (rect.Width < 1) { GetWindowRect(wnd, ref rect); } if (wnd == IntPtr.Zero) { wnd = FindWindow(null, "Login"); } } } int OCurX = Cursor.Position.X; int OCurY = Cursor.Position.Y; SetForegroundWindow(wnd); SetCursorPos(rect.X + 288, rect.Y + 210); mouse_event(LEFTDOWN | LEFTUP, Cursor.Position.X, Cursor.Position.Y, 0, UIntPtr.Zero); SetCursorPos(OCurX, OCurY); w.Hide(); this.WindowState = FormWindowState.Minimized; SavePassword(); }