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
'--------------------------------------------------
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
文章来源于领测软件测试网 https://www.ltesting.net/
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073










