I know someone has a good ShellExecute handler for VB. Can i have a copy of the code? THanks
Printable View
I know someone has a good ShellExecute handler for VB. Can i have a copy of the code? THanks
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]
Actually i'm executing a batch file. So instead of open do i use run?
I beleive it must be 'open'
Iouri Boutchkine
[email protected]