|
-
February 21st, 2006, 12:22 PM
#1
process problem
Hi everybody,
Here's my problem :
I want to be able to show or hide a process window while it is running.
Here is my code :
Process p = null;
p = new Process();
p.StartInfo.WorkingDirectory = "c:\\Program Files\\Internet Explorer\\";
p.StartInfo.FileName = "iexplore.exe";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.Start();
while (!p.HasExited)
{
Application.DoEvents();
if (showProcess)
{
// Which code here ??
}
Thread.Sleep(100);
}
void button_showOrHideProcess_click (...)
{
showProcess = !showProcess;
}
obviously process.startInfo has no effect when process is already running, so how can I make window visible ?
-
February 21st, 2006, 04:06 PM
#2
Re: process problem
Hi,
In order to make it visible you will have to use the Win32 API FindWindow method and once you have the handler to the IE window you should use SetForegroundWindow to bring it on top of all windows.
-
February 22nd, 2006, 03:44 AM
#3
Re: process problem
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|