|
-
Jan 31st, 2009, 09:39 AM
#1
Thread Starter
Junior Member
Hiding then Unhiding a Process
If you start an exe file by using a Process, you can set certain ProcessStartInfo parameters beforehand, such as CreateNoWindow = True (to hide the process), as in this example:
Dim myExe As New Process
Dim p As New System.Diagnostics.ProcessStartInfo
p.FileName = "cmd.exe" 'starts the cmd console
p.UseShellExecute = False
p.CreateNoWindow = True 'hides the cmd window
myExe.StartInfo = p
myExe.Start()
Once a process is started is it possible to 'undo' the hiding, without stopping and restarting the process? I would like to use:
p.CreateNoWindow = False
to unhide a hidden console application, but it does not work. Is there a way?
Rock
-
Jan 31st, 2009, 09:42 AM
#2
Re: Hiding then Unhiding a Process
As the name suggests, the ProcessStartInfo class contains info for starting a process. It has nothing to do with what happens to that process after it starts, so changing the CreateNoWindow after a process has started obviously can't be useful.
If what you want to do is possible it would have to be done using the Windows API. You might be able to force windows to create a handle for the main window of process after the fact from its process ID. That's only speculation though. I'd have no idea what function(s) might be able to do that for you.
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
|