Are there any shell command alternatives
Printable View
Are there any shell command alternatives
This is a better way than the Shell function.
Code:Private 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
Private Const SW_SHOWNORMAL = 1
Private Const SW_SHOWMINIMIZED = 2
Private Const SW_SHOWMAXIMIZED = 3
Private Const SW_SHOW = 5
Private Const SW_MINIMIZE = 6
Private Const SW_SHOWMINNOACTIVE = 7
Private Const SW_SHOWNA = 8
Private Const SW_RESTORE = 9
Private Const SW_SHOWDEFAULT = 10
Call ShellExecute(Me.hwnd, "C:\file.exe", "C:\", vbNullString,
vbNullString, SW_SHOWNORMAL)
Thanks for the reply..
My application does not use a form. Can I use something else than Me.hWnd ??
I believe you can use VbNullString.