public int ShowWindow(int windowHandle) { Console.WriteLine(windowHandle); var isSuccessful = WindowsFunctions.ShowWindow( new IntPtr(windowHandle), WindowsFunctions.ShowWindowCommand.SW_RESTORE ); return(!isSuccessful?Marshal.GetLastWin32Error() : 0); }