会员: 密码:  免费注册 | 忘记密码 | 会员登录 网页功能: 加入收藏 设为首页 网站搜索  
 安全技术技术文档
  · 安全配制
  · 工具介绍
  · 黑客教学
  · 防火墙
  · 漏洞分析
  · 破解专题
  · 黑客编程
  · 入侵检测
 安全技术论坛
  · 安全配制
  · 工具介绍
  · 防火墙
  · 黑客入侵
  · 漏洞检测
  · 破解方法
  · 杀毒专区
 安全技术工具下载
  · 扫描工具
  · 攻击程序
  · 后门木马
  · 拒绝服务
  · 口令破解
  · 代理程序
  · 防火墙
  · 加密解密
  · 入侵检测
  · 攻防演示
技术文档 > VB文档 > 窗体界面
类似IE地址栏的自动完成功能
发表日期:2003-04-18 00:00:00作者: 出处:  

Option Explicit

Private Const SHACF_AUTOSUGGEST_FORCE_ON As Long = &H10000000

Private Const SHACF_AUTOSUGGEST_FORCE_OFF As Long = &H20000000

Private Const SHACF_AUTOAPPEND_FORCE_ON As Long = &H40000000

Private Const SHACF_AUTOAPPEND_FORCE_OFF As Long = &H80000000

Private Const SHACF_DEFAULT As Long = &H0

Private Const SHACF_FILESYSTEM As Long = &H1

Private Const SHACF_URLHISTORY As Long = &H2

Private Const SHACF_URLMRU As Long = &H4

Private Const SHACF_URLALL As Long = (SHACF_URLHISTORY Or SHACF_URLMRU)

Private Const DLLVER_PLATFORM_WINDOWS As Long = &H1 'Windows 95

Private Const DLLVER_PLATFORM_NT As Long = &H2    'Windows NT

Private Type DllVersionInfo

  cbSize As Long

  dwMajorVersion As Long

  dwMinorVersion As Long

  dwBuildNumber As Long

  dwPlatformID As Long

End Type

Private Declare Function SHAutoComplete Lib "shlwapi" _

 (ByVal hwndEdit As Long, _

  ByVal dwFlags As Long) As Long

Private Declare Function DllGetVersion Lib "shlwapi" _

 (dwVersion As DllVersionInfo) As Long

Private Function GetIEVersion(DVI As DllVersionInfo) As Long

 

  DVI.cbSize = Len(DVI)

  Call DllGetVersion(DVI)

  GetIEVersion = DVI.dwMajorVersion

 

End Function

Private Function GetIEVersionString() As String

 

  Dim DVI As DllVersionInfo

 

  DVI.cbSize = Len(DVI)

  Call DllGetVersion(DVI)

  GetIEVersionString = "Internet Explorer " & _

            DVI.dwMajorVersion & "." & _

            DVI.dwMinorVersion & "." & _

            DVI.dwBuildNumber

 

End Function

Private Sub Command1_Click()

  Dim DVI As DllVersionInfo

  If GetIEVersion(DVI) >= 5 Then

 

   Call SHAutoComplete(Text1.hWnd, SHACF_DEFAULT)

   

   Command1.Caption = "SHAutoComplete is On"

   Command1.Enabled = False

   Text1.SetFocus

   Text1.SelStart = Len(Text1.Text)

 

  Else

 

   MsgBox "Sorry ... you need IE5 to use this demo", vbExclamation

   

  End If

 

End Sub

Private Sub Form_Load()

  Dim DVI As DllVersionInfo

  Label1.Caption = "Using Shlwapi.dll for " & GetIEVersionString

 

  Command1.Enabled = GetIEVersion(DVI) >= 5

  Command1.Caption = "SHAutoComplete is Off"

End Sub

返回顶部】 【打印本页】 【关闭窗口

关于我们 / 给我留言 / 版权举报 / 意见建议 / 网站编程QQ群   
Copyright ©2003- 2024 Lihuasoft.net webmaster(at)lihuasoft.net 加载时间 0.00139