How To? Closing Shelled DOS app when done 
Author Message
 How To? Closing Shelled DOS app when done

I have to shell out to a DOS app in the middle of my Win95 program. I
am able to start the DOS program, and I am able to wait until the DOS
program is finished. However, I do not know how to close the window
that is created for the DOS app.

Does anybody know the secret API call for this?

I'm calling the DOS program with the normal VB SHELL command using
vbminimized as the window state.

I'm using the GetExitCodeProcess API function to determine when the
app is done.

Thanks

Bob Smedley



Fri, 03 Mar 2000 03:00:00 GMT  
 How To? Closing Shelled DOS app when done

Keep things the way they are, but change the command line for the DOS app
adding "command.com /c" in front, ie:

  x= Shell("\path\command.com /c " & DOSapp2start, 1)

This will start a copy of command com, and the /c tells it to close the
window when done.

You may want to use the environ$ method as well to assure the correct path
to command.com

--
Randy Birch, MVP Visual Basic

Moderator, Fidonet Visual Basic Programmer's Conference
VBnet, The Visual Basic Developers Resource Centre
http://home.sprynet.com/sprynet/rasanen/



: I have to shell out to a DOS app in the middle of my Win95 program. I
: am able to start the DOS program, and I am able to wait until the DOS
: program is finished. However, I do not know how to close the window
: that is created for the DOS app.
:
: Does anybody know the secret API call for this?
:
: I'm calling the DOS program with the normal VB SHELL command using
: vbminimized as the window state.
:
: I'm using the GetExitCodeProcess API function to determine when the
: app is done.
:
: Thanks
:
: Bob Smedley
:
:



Fri, 03 Mar 2000 03:00:00 GMT  
 How To? Closing Shelled DOS app when done

Use the findwindow api call to locate the dos window that is open.
Once you have the hwnd for that window (The return value for
findwindow) use the PostMessage api call to send a WM_CLOSE message to
the window and it will close and cleanup after it self.

Hope this helps.

Jonathan Morrison

Quote:

>I have to shell out to a DOS app in the middle of my Win95 program. I
>am able to start the DOS program, and I am able to wait until the DOS
>program is finished. However, I do not know how to close the window
>that is created for the DOS app.

>Does anybody know the secret API call for this?

>I'm calling the DOS program with the normal VB SHELL command using
>vbminimized as the window state.

>I'm using the GetExitCodeProcess API function to determine when the
>app is done.

>Thanks

>Bob Smedley



Sat, 04 Mar 2000 03:00:00 GMT  
 How To? Closing Shelled DOS app when done

 Hi,

Take a look at the sample code I have in my site.
In the VB-Resumen look for: "Cmo saber si..." and you can download the
code.

Nos vemos.
Guillermo
--
============================================
Te invito a visitar mis pginas sobre
Visual Basic, HTML (VBScript, JavaScript...)
http://wcostasol.es/guille/
============================================
VB Online en espa?ol:
http://wcostasol.es/vbonline/
============================================



Quote:
>I have to shell out to a DOS app in the middle of my Win95 program. I
>am able to start the DOS program, and I am able to wait until the DOS
>program is finished. However, I do not know how to close the window
>that is created for the DOS app.

>Does anybody know the secret API call for this?

>I'm calling the DOS program with the normal VB SHELL command using
>vbminimized as the window state.

>I'm using the GetExitCodeProcess API function to determine when the
>app is done.

>Thanks

>Bob Smedley



Sun, 05 Mar 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. closing dos app's window after shell

2. How to Close a DOS app after running from Shell()

3. how to wait till DOS shell prog is done

4. When is a Shell app. done

5. Close a DOS Shell Out

6. detecting close of a shelled dos program in vb5

7. detecting close of a shelled dos program in vb5

8. Closing a DOS Shell

9. Closing DOS prompt after Shell

10. Close DOS Batch File after Shell Command

11. detecting close of a shelled dos program in vb5

12. ? Shell to a DOS Window, then close it

 

 
Powered by phpBB® Forum Software