using System;
using System.Runtime.InteropServices;
using System.Threading;
class TestClass
{
static void Main (string[] args)
{
New TestClass ()
[DllImport ("User32.dll", EntryPoint = "FindWindow")]
private static extern IntPtr FindWindow (String lpclassn Ame,string lpwindowname);
[DllImport ("user32.dll", EntryPoint = "FindWindowEx")]//Find subform
private static extern IntPtr FindWindowEx (intp TR hwndparent,intptr Hwndchildafter, String lpszclass, string lpszwindow); --www.bianceng.cn
[DllImport ("User32.dll", EntryPoint = "SendMessage")]//For sending information to form
private static extern I NT SendMessage (IntPtr hwnd,int Msg, IntPtr wParam, string lParam);
[DllImport ("User32.dll", EntryPoint = "ShowWindow")]//
private static extern bool ShowWindow (IntPtr hWnd, I NT type);
Public TestClass ()
{
System.Diagnostics.Process p = new System.Diagnostics.Process ();
p.StartInfo.FileName = "NOTepad. EXE ";//Open a notepad program
P.startinfo.useshellexecute = false;
P.startinfo.redirectstandardinput = true;
P.startinfo.redirectstandardoutput = true;
P.startinfo.redirectstandarderror = true;
P.startinfo.createnowindow = true;
P.start ();
P.close ();
Console.title = "1111";
IntPtr Parenthwnd = new IntPtr (0);
IntPtr et = new INTPTR (0);
Parenthwnd = FindWindow (null, "1111");
if (! Parenthwnd.equals (IntPtr.Zero))
Console.WriteLine ("Show");
Else
Console.WriteLine ("Error");
ShowWindow (Parenthwnd, 0);//Hide this dos form
Console.read ();
}
}