-
Aug 12th, 2022, 01:38 PM
#1
Thread Starter
Addicted Member
Process starts but does not display window
I have an application that I am trying to launch another exe from. The second exe does start because you can see it in the task manger but the application window does not appear on the screen? Any help would be appreciated.
Code:
Dim p As New ProcessStartInfo("\\gvl02\data\programs\assembly\labels\labels.exe")
p.WindowStyle = ProcessWindowStyle.Normal
p.Arguments = filterString
Process.Start(p)
-
Aug 12th, 2022, 01:57 PM
#2
Re: Process starts but does not display window
Before descending down the road of assuming the code is at fault, if you use Windows File Explorer to navigate to the UNC path you've indicated and execute the file manually, does it run as expected (visibly)? Or does it run "hidden" that way as well?
If it runs normally that way, then you may have to set the .WorkingDirectory property of your "p" object to the UNC path of the .exe file (or, perhaps some other path if appropriate).
Good luck.
-
Aug 13th, 2022, 08:30 AM
#3
Lively Member
Re: Process starts but does not display window
Does label.exe even have an normal windowstyle? If not maybe this is the reason you can't see it. You could try to remove that line and see if it works.
-
Aug 15th, 2022, 11:48 AM
#4
Thread Starter
Addicted Member
Re: Process starts but does not display window
If I navigate and run it, it runs as expected. And I did try the Working directory and still same issue and the WindowsState is set to Normal in the labels.exe
-
Aug 15th, 2022, 12:26 PM
#5
Re: Process starts but does not display window
Originally Posted by BSWhipp
If I navigate and run it, it runs as expected. And I did try the Working directory and still same issue and the WindowsState is set to Normal in the labels.exe
Try it like this,
Code:
Dim myProc As Process
Dim pi As New ProcessStartInfo()
pi.FileName = "\\gvl02\data\programs\assembly\labels\labels.exe"
' pi.FileName = "notepad"
pi.UseShellExecute = True ' False '
pi.CreateNoWindow = True ' False '
pi.WindowStyle = ProcessWindowStyle.Normal
pi.Arguments = filterString
myProc = Process.Start(pi)
myProc.WaitForExit()
These two can be set differently when trying,
Code:
pi.UseShellExecute = True ' False '
pi.CreateNoWindow = True ' False '
-
Aug 15th, 2022, 12:36 PM
#6
Thread Starter
Addicted Member
Re: Process starts but does not display window
Loads the labels.exe the same (No window) and stops the processing of the program that launches it.. Go to be something with the program that is running it. Like it won't allow the window to come up for the external program.
-
Aug 15th, 2022, 12:45 PM
#7
Re: Process starts but does not display window
Originally Posted by BSWhipp
Loads the labels.exe the same (No window) and stops the processing of the program that launches it.. Go to be something with the program that is running it. Like it won't allow the window to come up for the external program.
Did you set this
pi.CreateNoWindow
to false with the same results?
-
Aug 16th, 2022, 07:33 AM
#8
Lively Member
Re: Process starts but does not display window
It looks like the file is located on a network share. Maybe it is a permision problem. You could try to copy the file to your computer and see if it will run then (as far as posible while not running on the expected location). You could also try to create a batch script and see if it will work then. If so maybe the solution could be to link your program to batch script.
-
Aug 16th, 2022, 07:36 AM
#9
Thread Starter
Addicted Member
Re: Process starts but does not display window
No, not a permission problem. I changed the code to run notepad and still same issue with notepad. Has to be the application that is calling the my dll that is not allowing it to be seen.
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
|