Process.StartInfo.WindowStyle not working

I'm simply trying to start a Windows app using System.Diagnostics.Process and make it "invisible" to the user.  Can someone tell me why this isnt working?  The program starts, but always shows up.

        Dim procQWS As New Process()

        procQWS.StartInfo.UseShellExecute = False
        procQWS.StartInfo.CreateNoWindow = True
        procQWS.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
        procQWS.StartInfo.FileName = "C:\Program Files\QWS3270 Plus\qws3270p.exe"
        procQWS.Start()
LVL 1
Epiphany1105Asked:
Who is Participating?
 
kodiakbearConnect With a Mentor Commented:
Closed, 250 points refunded.
kb
Experts Exchange Moderator
0
 
riyazthadCommented:
Try after removing this line

procQWS.StartInfo.UseShellExecute = False

Thad
0
 
YZlatCommented:
try

Dim procQWS As New Process()
Dim startInfo as ProcessStartInfo= new ProcessStartInfo()
        startInfo.UseShellExecute = False
        startInfo.CreateNoWindow = True
        startInfo.WindowStyle = ProcessWindowStyle.Hidden
        startInfo.FileName = "C:\Program Files\QWS3270 Plus\qws3270p.exe"
        procQWS.Start(startInfo)
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Epiphany1105Author Commented:
riyazthad and YZlat,
     I tried both of your suggestions and the program is still visible to the user.
0
 
Epiphany1105Author Commented:
I notice that if I switch out the app i'm trying to use (C:\Program Files\QWS3270 Plus\qws3270p.exe) with Notepad (notepad.exe), notepad starts and is not visible.
0
 
Epiphany1105Author Commented:
I figured it out.  QWS was setting a flag in the registry named zoomed which was causing it to maximize itself.  
0
 
riyazthadCommented:
I just tried with a small program, and it is working fine. So your application setting was the problem.?

0
 
Epiphany1105Author Commented:
Yes.  I figure that it was deciding weather it should maximize itself based on that setting.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.