Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1037
  • Last Modified:

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()
0
Epiphany1105
Asked:
Epiphany1105
1 Solution
 
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
 
Epiphany1105Author Commented:
riyazthad and YZlat,
     I tried both of your suggestions and the program is still visible to the user.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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
 
kodiakbearCommented:
Closed, 250 points refunded.
kb
Experts Exchange Moderator
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now