mWebApi.bas
资源名称:IE_VB.rar [点击查看]
上传用户:davilee3
上传日期:2015-04-22
资源大小:986k
文件大小:5k
源码类别:
浏览器
开发平台:
Visual Basic
- Attribute VB_Name = "mWebApi"
- Option Explicit
- Public Const MAX_PATH = 260
- 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
- Public Declare Function DoAddToFavDlg Lib "shdocvw.dll" (ByVal hwndParent As Long, ByVal lpszPath As String) As Long
- Public Declare Function AddUrlToFavorites Lib "shdocvw.dll" (ByVal hwndParent As Long, ByVal lpszPath As String) As Long '这个函数的参数定义有问题。
- Public Const CSIDL_ADMINTOOLS As Long = &H30
- Public Const CSIDL_ALTSTARTUP As Long = &H1D
- Public Const CSIDL_APPDATA As Long = &H1A
- Public Const CSIDL_BITBUCKET As Long = &HA
- Public Const CSIDL_COMMON_ADMINTOOLS As Long = &H2F
- Public Const CSIDL_COMMON_ALTSTARTUP As Long = &H1E
- Public Const CSIDL_COMMON_APPDATA As Long = &H23
- Public Const CSIDL_COMMON_DESKTOPDIRECTORY As Long = &H19
- Public Const CSIDL_COMMON_DOCUMENTS As Long = &H2E
- Public Const CSIDL_COMMON_FAVORITES As Long = &H1F
- Public Const CSIDL_COMMON_PROGRAMS As Long = &H17
- Public Const CSIDL_COMMON_STARTMENU As Long = &H16
- Public Const CSIDL_COMMON_STARTUP As Long = &H18
- Public Const CSIDL_COMMON_TEMPLATES As Long = &H2D
- Public Const CSIDL_CONNECTIONS As Long = &H31
- Public Const CSIDL_CONTROLS As Long = &H3
- Public Const CSIDL_COOKIES As Long = &H21
- Public Const CSIDL_DESKTOP As Long = &H0
- Public Const CSIDL_DESKTOPDIRECTORY As Long = &H10
- Public Const CSIDL_DRIVES As Long = &H11
- Public Const CSIDL_FAVORITES As Long = &H6
- Public Const CSIDL_FLAG_CREATE As Long = &H8000
- Public Const CSIDL_FLAG_DONT_VERIFY As Long = &H4000
- Public Const CSIDL_FLAG_MASK As Long = &HFF00&
- Public Const CSIDL_FLAG_PFTI_TRACKTARGET As Long = CSIDL_FLAG_DONT_VERIFY
- Public Const CSIDL_FONTS As Long = &H14
- Public Const CSIDL_HISTORY As Long = &H22
- Public Const CSIDL_INTERNET As Long = &H1
- Public Const CSIDL_INTERNET_CACHE As Long = &H20
- Public Const CSIDL_LOCAL_APPDATA As Long = &H1C
- Public Const CSIDL_MYPICTURES As Long = &H27
- Public Const CSIDL_NETHOOD As Long = &H13
- Public Const CSIDL_NETWORK As Long = &H12
- Public Const CSIDL_PERSONAL As Long = &H5
- Public Const CSIDL_PRINTERS As Long = &H4
- Public Const CSIDL_PRINTHOOD As Long = &H1B
- Public Const CSIDL_PROFILE As Long = &H28
- Public Const CSIDL_PROGRAM_FILES As Long = &H26
- Public Const CSIDL_PROGRAM_FILES_COMMON As Long = &H2B
- Public Const CSIDL_PROGRAM_FILES_COMMONX86 As Long = &H2C
- Public Const CSIDL_PROGRAM_FILESX86 As Long = &H2A
- Public Const CSIDL_PROGRAMS As Long = &H2
- Public Const CSIDL_RECENT As Long = &H8
- Public Const CSIDL_SENDTO As Long = &H9
- Public Const CSIDL_STARTMENU As Long = &HB
- Public Const CSIDL_STARTUP As Long = &H7
- Public Const CSIDL_SYSTEM As Long = &H25
- Public Const CSIDL_SYSTEMX86 As Long = &H29
- Public Const CSIDL_TEMPLATES As Long = &H15
- Public Const CSIDL_WINDOWS As Long = &H24
- '---------------------------------------------------------------------------------------
- ' Procedure : QueryOffline
- ' DateTime : 2005-4-15 15:12
- ' Author : Lingll
- ' Purpose :
- '---------------------------------------------------------------------------------------
- Public Function QueryOffline() As Boolean
- Dim hKey&
- Dim sz&
- If RegOpenKey(HKEY_CURRENT_USER, "SoftwareMicrosoftWindowsCurrentVersionInternet Settings", hKey) = ERROR_SUCCESS Then
- If RegQueryValueExLong(hKey, "GlobalUserOffline", 0&, REG_DWORD, sz, 4) = ERROR_SUCCESS Then
- QueryOffline = (sz = 1)
- Else
- QueryOffline = False
- End If
- RegCloseKey hKey
- Else
- QueryOffline = False
- End If
- End Function
- '---------------------------------------------------------------------------------------
- ' Procedure : SetOffline
- ' DateTime : 2005-4-15 15:21
- ' Author : Lingll
- ' Purpose :
- '---------------------------------------------------------------------------------------
- Public Sub SetOffline(vOffline As Boolean)
- Dim hKey&
- Dim sz&
- If RegOpenKey(HKEY_CURRENT_USER, "SoftwareMicrosoftWindowsCurrentVersionInternet Settings", hKey) <> ERROR_SUCCESS Then
- If RegCreateKey(HKEY_CURRENT_USER, "SoftwareMicrosoftWindowsCurrentVersionInternet Settings", hKey) <> ERROR_SUCCESS Then
- Exit Sub
- End If
- End If
- sz = BooleanToBool(vOffline)
- Call RegSetValueExLong(hKey, "GlobalUserOffline", 0&, REG_DWORD, sz, 4)
- Call RegCloseKey(hKey)
- Call InternetSetOption(0&, INTERNET_OPTION_SETTINGS_CHANGED, 0&, 0)
- End Sub