- Private m_hMod As Long
- Private m_hMod2 As Long
- Private Declare Function InitCommonControlsEx Lib "comctl32.dll" (iccex As tagInitCommonControlsEx) As Boolean
- Private Type tagInitCommonControlsEx
- lngSize As Long
- lngICC As Long
- End Type
- Private Const ICC_USEREX_CLASSES = &H200
- Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
- Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
- Private Sub Form_Initialize()
- Dim iccex As tagInitCommonControlsEx
- iccex.lngSize = LenB(iccex)
- iccex.lngICC = ICC_USEREX_CLASSES
- InitCommonControlsEx iccex
- m_hMod = LoadLibrary("shell32.dll")
- m_hMod2 = LoadLibrary("explorer.exe")
- End Sub
- Private Sub Form_Load()
- WebBrowser1.Navigate2 "http://www.google.com/"
- End Sub
- Private Sub Form_Terminate()
- If m_hMod Then FreeLibrary m_hMod
- If m_hMod2 Then FreeLibrary m_hMod2
- End Sub
注:如果想让窗体上的控件支持XP,需要添加一个Manifest资源