private static MoveTimedEvent CreateParallelTimer(int timeoutDelay, Dictionary <string, object> args) { MoveTimedEvent timedEvent = new MoveTimedEvent(timeoutDelay); timedEvent.Args = args; timedEvent.OnFire += Move; return(timedEvent); }
private static void Move(MoveTimedEvent evt) { evt.Kill(); var data = evt.Args; RECT rect = new RECT(); RECT mainwindow = new RECT(); IntPtr mbWnd = FindWindow("#32770", (string)data["Caption"]); // lpClassName is #32770 for MessageBox IntPtr mainwindowhandle = FindWindow(null, "SquadRconClient"); if (mbWnd != IntPtr.Zero && mainwindowhandle != IntPtr.Zero) { GetWindowRect(mbWnd, ref rect); GetWindowRect(mainwindowhandle, ref mainwindow); MoveWindow(mbWnd, (rect.Right - rect.Left) * 2, (rect.Bottom - rect.Top) * 2, rect.Right - rect.Left, rect.Bottom - rect.Top, true); } }