|
-
September 24th, 2001, 10:20 AM
#1
ShellExecute
I know someone has a good ShellExecute handler for VB. Can i have a copy of the code? THanks
-
September 24th, 2001, 10:44 AM
#2
Re: ShellExecute
The regular "Shell" command won't open files, just execute them. To open files with Word, Excel,
Notepad - whatever, use this API - ShellExecute:
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Const SW_SHOWNORMAL = 1
Dim iRetVal as Long
iRetVal = ShellExecute(Me.hwnd, "open", "C:\bootlog.txt", vbNullString, "c:\", SW_SHOWNORMAL)
This will open notepad and have notepad open the bootlog.txt file (if it exists).
"open" to open or execute
"print"
"explore"
Iouri Boutchkine
[email protected]
-
September 24th, 2001, 11:18 AM
#3
Re: ShellExecute
Actually i'm executing a batch file. So instead of open do i use run?
-
September 24th, 2001, 11:40 AM
#4
Re: ShellExecute
I beleive it must be 'open'
Iouri Boutchkine
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|