几个设置IE的API

页面导航:首页 > 软件编程 > vb.net > 几个设置IE的API

几个设置IE的API

来源: 作者: 时间:2016-02-05 12:32 【

Option ExplicitPublic Const MAX_PATH = 260Public Const CSIDL_FAVORITES = H6Public Declare Function LaunchInternetControlPanel Lib "inetcpl.cpl

 

 

Option Explicit

 

Public Const MAX_PATH = 260

Public Const CSIDL_FAVORITES = &H6

 

Public Declare Function LaunchInternetControlPanel Lib "inetcpl.cpl" (ByVal hwndParent As Long) As Long

Public Declare Function LaunchConnectionDialog Lib "inetcpl.cpl" (ByVal hwndParent As Long) As Long

Public Declare Function LaunchSecurityDialog Lib "inetcpl.cpl" (ByVal hwndParent As Long) As Long

Public Declare Function LaunchSiteCertDialog Lib "inetcpl.cpl" (ByVal hwndParent As Long) As Long

Public Declare Function OpenFontsDialog Lib "inetcpl.cpl" (ByVal hwndParent As Long) As Long

Public Declare Function DoOrganizeFavDlg Lib "shdocvw.dll" (ByVal hwndParent As Long, ByVal lpszPath As String) As Long

Public Declare Function SHGetSpecialFolderPath Lib "shell32.dll" Alias "SHGetSpecialFolderPathA" (ByVal hwndOwner As Long, ByVal lpszPath As String, ByVal nFolder As Long, ByVal fCreate As Long) As Long

 

--------------------------------------------------

 

FRMMAIN.FRM:

 

Private Sub Command1_Click()

  Dim rc As Long

  

  rc = LaunchInternetControlPanel(Me.hWnd)

  Debug.Print GetLastError

  If rc = 0 Then

    MsgBox "LaunchInternetControlPanel failed!", vbExclamation

  End If

End Sub

 

Private Sub Command2_Click()

  Dim rc As Long

  

  rc = LaunchConnectionDialog(Me.hWnd)

  Debug.Print GetLastError

  If rc = 0 Then

    MsgBox "LaunchConnectionDialog failed!", vbExclamation

  End If

End Sub

 

Private Sub Command3_Click()

  Dim rc As Long

  Dim strFavPath As String * MAX_PATH

  

  SHGetSpecialFolderPath Me.hWnd, strFavPath, CSIDL_FAVORITES, False

  rc = DoOrganizeFavDlg(Me.hWnd, strFavPath)

  Debug.Print GetLastError

  If rc = 0 Then

    MsgBox "DoOrganizeFavDlg failed!", vbExclamation

  End If

End Sub

 

Private Sub Command4_Click()

  Dim rc As Long

  

  rc = LaunchSiteCertDialog(Me.hWnd)

  Debug.Print GetLastError

  If rc = 0 Then

    MsgBox "LaunchSiteCertDialog failed!", vbExclamation

  End If

End Sub 

Tags:

相关文章

    文章评论

    最 近 更 新
    热 点 排 行
    Js与CSS工具
    代码转换工具
    
    <