| | | Forum Newbie
       
Group: Forum Members Last Login: 9/22/2008 9:08:09 PM Posts: 3, Visits: 4 |
| Hello all...
I am trying to write a quick little file that will do the following:
On Form Load launch another program "C:\Windows\Notepad.exe"
Then go in to a wait status
When Notepad.exe is closed, Unload Me.
I am having trouble with the wait and unload piece. It launches the program and then does nothing else.
Any help would be great. |
| | | | Forum Member
       
Group: Forum Members Last Login: 10/25/2008 11:59:43 AM Posts: 72, Visits: 370 |
| I'm confused about what you are asking. Why open a seperate form to open Notepad. Just use: Shell "C:\Windows\Notepad.exe", vbNormalFocus and close It when you are finished. |
| | | | Forum Newbie
       
Group: Forum Members Last Login: 9/22/2008 9:08:09 PM Posts: 3, Visits: 4 |
| | Thanks for the input, but "Notepad" was an example. I was able to figure this issue out. |
| | | | 
Forum God
       
Group: Forum Members Last Login: Yesterday @ 7:34:31 PM Posts: 1,465, Visits: 3,404 |
| Welcome to A1vbcode gbargsley.  I've just read the same type of question here 
Keith http://www.martin2k.co.uk/forums/ I've been programming with VB for 12 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning. |
| | | | Forum God
       
Group: Forum Members Last Login: 2 days ago @ 4:38:01 AM Posts: 886, Visits: 5,287 |
| | I know you found a solution but here is a simple way of doing it. Private Sub RunAppAndWait(ByVal AppPath As String) Dim wshShell
Set wshShell = CreateObject("WSCript.shell") wshShell.run AppPath, 5, True Set wshShell = Nothing End Sub
Private Sub Form_Activate() MsgBox "Exiting" Unload Me End Sub
Private Sub Form_Load() RunAppAndWait "Notepad.exe" End Sub
|
| |
|
|