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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a shell program

Status
Not open for further replies.

sdillard

Technical User
Oct 23, 2001
32
0
0
US
I am trying to start another application as a shell app within my VB application. Is there a way I can temporarily stop my VB application until the shell completes execution? It seems to compete with my VB app for CPU resources and therefore runs very slow and unpredictably.

Thanks
 
What do u mean by stop?
Do u want to close ur application for a while.
Is ur application doing something else at the moment to open the other application?

I would like to help but u need to be more specific about what ur application do and is doing.
 
Yes and yes. Use the Shell() command. I have written numerous posts about its implementation, so just do a search. Nate Gagne
nathan.gagne@verizon.net
AKA Nick Burns - Your Company's Computer Guy
"Would you like me to save your game of Minesweeper first?"

Like my post? Let me know it was helpful!
 
I located the code that uses the WaitForSingleObject. I incorporated this into my application and it works fine for starting the shell. However, I need to be able to start my shell, let control go back to my VB app, and then at a later time go back to the shell and close it. My problem is when I want to go back to the shell and close it, I can't get the VB application to relenquish control and let the shell commands (Sendkeys) execute. These shell commands are supposed to close the Shell app but they seem to bog down when they are competing with the VB app for resources. Opening the shell application isn't a problem but coming back to it later to close it is.

Thanks for any help you can provide.
 
Try looking at thread222-169146 which offers some code that allows you to shell a named program, and returns a structure containing a whole bunch of process info (eg process handle, thread handle, HWnd). That info would allow you to go back later and examine what the process is doing, or even if it still exists.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top