Activate other process

B

Bsiang Tan

Is there any way to activate or bring the process to front ?
For example, my application will run the windows calculator. After certain
process, I will need to activate the calculator...

I know how to runthe windows calculator..
is Process.Start("calc.exe")

but when I wish to activate the it, I have no idea..
I know there is a function AppActivate( ) in VB..
is there any equivalent function in C# ?
Thank a lot ~

Best regard,
Bsiang
 
A

Andrew Gnenny

Hi,
You can use such approach:
1. Get Process class instance returned by Process.Start
2. Query Process.MainWindowHandle
3. Call unmanaged Win32 API function "ShowWindow" or "SwitchToThisWindow"
--
Andrew Gnenny
pulsar2003@/no-spam/email.ru (Please remove /no-spam/ for reply)
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top