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 Declare Function GetDesktopWindow Lib "user32" () As LongPrivate Sub Command2_Click() Dim GetErr As Long Dim Scr_hDC As Long Scr_hDC = GetDesktopWindow() GetErr = ShellExecute(Scr_hDC, "Open", "图片文件全路径", "", "", 1) End Sub如果是其他图片编辑软件打开的,可以设置: 右击图片->属性->更改->选中"windows图片和传真查看器"即可
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 Declare Function GetDesktopWindow Lib "user32" () As LongPrivate Sub Command2_Click()
Dim GetErr As Long
Dim Scr_hDC As Long
Scr_hDC = GetDesktopWindow()
GetErr = ShellExecute(Scr_hDC, "Open", "图片文件全路径", "", "", 1)
End Sub如果是其他图片编辑软件打开的,可以设置:
右击图片->属性->更改->选中"windows图片和传真查看器"即可