public static Bitmap CaptureWindow(IntPtr hWnd) { if (!Win32Helper.BringWindowToTop(hWnd)) { return(null); } if (!Win32Helper.SetForegroundWindow(hWnd)) { return(null); } return(CaptureHandle(hWnd)); }
private void ShowErrorMessage(string message) { Win32Helper.BringWindowToTop(this.Handle); Win32Helper.SetForegroundWindow(this.Handle); MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }