Click here to Skip to main content
15,867,991 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a program that uses the shell command to run another application.
prog_id = Shell("C:\Program Files\Mikroelektronika\mikroProg Suite For PIC\mikroProg Suite For PIC.exe -w -pPIC18LF13K22 -f" + Chr(34) + f + Chr(34), AppWinStyle.NormalFocus, True, 17000)
This command work correctly until the program
mikroProg Suite For PIC.exe 
has an error and it generates an error or message box. The shell command is unable to quit the program. How can I discover if such a dialog or message box is being displayed by the
mikroProg Suite For PIC.exe
program and how can it regain control.

Thank you for your help
Posted
Comments
CHill60 3-Jun-15 8:00am    
Try Shell(chr(34) + "C:\Program Files\Mikroelektronika\mikroProg Suite For PIC\mikroProg Suite For PIC.exe" + chr(34) + " -w -pPIC18LF13K22 -f" + Chr(34) + f + Chr(34), AppWinStyle.NormalFocus, True, 17000)
Robopike 3-Jun-15 11:08am    
Sorry that line work correctly. what i ment was. If the other program generates a dialog box how can i detect it?

1 solution

Better try to avoid using any VB-specific API. Use .NET BCL and FCL: https://msdn.microsoft.com/en-us/library/system.diagnostics.process.start%28v=vs.110%29.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900