原创 如何在webbrwoser控件中使用XP风格收藏

在XP操作系统下,在VB的webbrowser控件中的按钮等是没有XP风格的。下面的代码可以使webbrowser控件中的页面显示XP风格:

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

发表于 @ 2005年11月06日 10:12:00|评论(loading...)

新一篇: 如何在 Windows NT 和 Windows 2000 中使用自定义页面大小打印 | 旧一篇: 一个奇怪的错误

用户操作
[即时聊天] [发私信] [加为好友]
陈锐
订阅我的博客
XML聚合  FeedSky
订阅到鲜果
订阅到Google
订阅到抓虾
文章分类
收藏
    Graphics File Formats FAQ
    Adding Custom Buttons to Internet Explorer
    Creating a Windows DLL with Visual Basic
    Graphics File Formats FAQ (Part 1 of 4): General Graphics Format Questions
    Graphics File Formats FAQ (Part 2 of 4): Image Conversion and Display Programs
    Graphics File Formats FAQ (Part 3 of 4): Where to Get File Format Specifications
    Graphics File Formats FAQ (Part 4 of 4): Tips and Tricks of the Trade
    Visual Basic乱七八糟
    朋友的Blog
    小雨的Blog(RSS)
    瓜少之胡言乱语(RSS)
    美女苏胖墩的BLOG
    莫依的博客
    道士摄影
    马宁的Blog(RSS)
    我得主页
    AppleVB
    一些杂七杂八的东西
    40个常用的JS
    存档
    软件项目交易
    Csdn Blog version 3.1a
    Copyright © 陈锐