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 Sub Form_Load() ShellExecute 0&, "open", "d:\2.jpg", vbNullString, vbNullString, SW_SHOWNORMAL end sub
比如notepad c:\123.txt
Private Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
ShellExecute 0&, "open", "d:\2.jpg", vbNullString, vbNullString, SW_SHOWNORMAL
end sub