VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Easly load any program from your VB program. Uses Shell to load new program, also fully documente

by Sam Witney (7 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 20th December 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Easly load any program from your VB program. Uses "Shell" to load new program, also fully documented code too. Very simple, and easy to apply

API Declarations


'Just place the code in any Sub, or any point in your program, a command button for example.

Rate Easly load any program from your VB program. Uses Shell to load new program, also fully documente




On Error GoTo loaderror ' tells the program to go to the loaderror (see below) if there is an error
Path$ = "c:\windows\notepad.exe" ' replace with the program of your choice
Shell Path$, vbMaximizedFocus ' this will load the program, maximised and with the focus - ie active. change as needed. - this is the important bit, and can be used on its own, just replace Path$ with a "c:\wi...."!

Exit Sub
loaderror: ' the program jumps to here if there is an error, avoiding the program crashing.
MsgBox Err.Number & " " & Err.Description, vbCritical, "Error" ' message to user

Download this snippet    Add to My Saved Code

Easly load any program from your VB program. Uses Shell to load new program, also fully documente Comments

No comments have been posted about Easly load any program from your VB program. Uses Shell to load new program, also fully documente. Why not be the first to post a comment about Easly load any program from your VB program. Uses Shell to load new program, also fully documente.

Post your comment

Subject:
Message:
0/1000 characters