1. 程式人生 > >C#程式怎麼操作某個程序的窗體顯示隱藏

C#程式怎麼操作某個程序的窗體顯示隱藏

Intptr intptr=Process. GetProcessesByName("name").Handle;
 
ShowWindow(intptr,0);
ShowWindow(intptr,1);
 

[DllImport("user32.dll", EntryPoint = "ShowWindow", SetLastError = true)]
static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow);