'来个复杂的
Private Type SHELLEXECUTEINFO
cbSize As Long
fMask As Long
hwnd As Long
lpVerb As String
lpFile As String
lpParameters As String
lpDirectory As String
nShow As Long
hInstApp As Long
' Optional fields
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Private Declare Function ShellExecuteEx Lib "shell32.dll" Alias "ShellExecuteExA" (ByRef lpExecInfo As SHELLEXECUTEINFO) As Long
Private Const SEE_MASK_CLASSNAME = &H1
Private Sub Command1_Click()
Dim exeinf As SHELLEXECUTEINFO
With exeinf
.cbSize = LenB(exeinf)
.fMask = SEE_MASK_CLASSNAME
.hwnd = Me.hwnd
.lpVerb = "edit"
'----------------------------
.lpFile = "d:\temp.bmp" '要编辑的文件!
'----------------------------
.lpParameters = vbNullString
.lpDirectory = vbNullString
.nShow = vbNormalFocus
.lpClass = "Paint.Picture"
End With
ShellExecuteEx exeinf
End Sub
Option Explicit
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 Sub Command1_Click()
SavePicture Picture1.Picture, "d:\temp.bmp"
ShellExecute Me.hwnd, "open", "d:\temp.bmp", "pbrush.exe", vbNullString, 1
End Sub
Option Explicit
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 Sub Command1_Click()
SavePicture Picture1.Picture, "d:\temp.bmp"
ShellExecute Me.hwnd, "open", "d:\temp.bmp", "C:\Program Files\Accessories\mspaint.exe", vbNullString, 1
End Sub