Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CreateProcessWithLogonW - how to run in hidden window

Status
Not open for further replies.

haddaway

Programmer
Jul 6, 2005
172
SE
Let's say I want to start notepad.exe. It's a bad example, but how can I make it run in hidden mode with the WindowsAPI above?

thanks
 
There's a very simple way to start an application hidden in VB .NET:

Code:
Dim P As New Process
With P.StartInfo
  .FileName = "notepad.exe"
  .WindowStyle = ProcessWindowStyle.Hidden
End With
P.Start()

But if you insist on using the API above, you have to set the STARTF_USESHOWWINDOW on STARTUPINFO.dwFlags and set STARTUPINFO.wShowWindow to 0 (zero).

Regards, Ruffnekk
---
Is it my imagination or do buffalo wings taste just like chicken?
 
I does not seem to work. I use:

myStartUpInfo.wShowWindow = 0

and it still shows. Do I have to do anything more than settings that to 0 and adding the startupinfo to the process?

What about CreationFlags? Right now I am using default.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top