using System.Diagnostics; using System.Runtime.InteropServices; namespace MyApp { public partial class frmApp : Form { private const int SW_HIDE = 0; private const int SW_RESTORE = 9; private int hWnd; [DllImport("User32")] private static extern int ShowWindow(int hwnd, int nCmdShow); private void btnShow_Click(object sender, EventArgs e) { //Seleciona o primeiro processo Process p = Process.GetProcesses()[0]; hWnd = (int)p.MainWindowHandle; ShowWindow(hWnd, SW_RESTORE); } } }Parte do exemplo foi retirado do site C# Corner
Abaixo a tabela completa dos estados retirado do site DaniWeb:
0 SW_HIDE
1 SW_SHOWNORMAL
1 SW_NORMAL
2 SW_SHOWMINIMIZED
3 SW_SHOWMAXIMIZED
3 SW_MAXIMIZE
4 SW_SHOWNOACTIVATE
5 SW_SHOW
6 SW_MINIMIZE
7 SW_SHOWMINNOACTIVE
8 SW_SHOWNA
9 SW_RESTORE
10 SW_SHOWDEFAULT
11 SW_FORCEMINIMIZE
11 SW_MAX