private void KillMessageBox() { IntPtr ptr = DllImportUtil.FindWindow(null, WM_Caption); if (ptr != IntPtr.Zero) { DllImportUtil.PostMessage(ptr, WM_CLOSE, IntPtr.Zero, IntPtr.Zero); } }
private void timer1_Tick(object sender, EventArgs e) { if (Handle1 != DllImportUtil.GetForegroundWindow() && bForeground) { frmShow(); this.Activate(); this.TopMost = true; DllImportUtil.SetForegroundWindow(Handle1); bForeground = false; } }