Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteW" (ByVal hWnd As LongPtr, ByVal lpOperation As LongPtr, ByVal lpFile As LongPtr, ByVal lpParameters As LongPtr, Optional ByVal lpDirectory As LongPtr = 0^, Optional ByVal nShowCmd As ShowCM = 1) As Long
#Else
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteW" (ByVal hWnd As Long, ByVal lpOperation As Long, ByVal lpFile As Long, ByVal lpParameters As Long, Optional ByVal lpDirectory As Long=0, Optional ByVal nShowCmd As ShowCM = 1) As Long
#End If
Public Enum ShowCM
SW_SHOWNORMAL = 1&
SW_SHOWMINIMIZED = 2&
SW_SHOWMAXIMIZED = 3&
SW_SHOWNOACTIVATE = 4&
SW_SHOW = 5&
SW_SHOWMINNOACTIVE = 7&
SW_SHOWNA = 8&
SW_SHOWDEFAULT = 10&
End Enum
Public Function ShellOpenFile(ByVal FileName As String, Optional ByVal ShowMode As ShowCM = 1)