我想用VB打开一个图片文件,不用VB的图片控件,而是调用系统默认程序Windows图片和传真查看器,请各位高手多多帮忙!

解决方案 »

  1.   

    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图片和传真查看器"即可