Shell 是用來執行外部的可執行檔
如果是一個文件,那要用ShellExecute來啟動預設的程式來開啟文件
'HINSTANCE ShellExecute(
' HWND hwnd, // handle to parent window
' LPCTSTR lpOperation, // pointer to string that specifies operation to perform
' LPCTSTR lpFile, // pointer to filename string
' LPTSTR lpParameters, // pointer to string that specifies executable-file parameters
' LPCTSTR lpDirectory, // pointer to string that specifies default directory
' INT nShowCmd // whether file is shown when opened
' );
例:.doc 是由word或wordpad來開啟
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
Const SW_SHOW = 5
ret = ShellExecute(me.hWnd, "open" , "文件完整路徑及名稱","", "", SW_SHOW
|