mFavMenu.bas
资源名称:IE_VB.rar [点击查看]
上传用户:davilee3
上传日期:2015-04-22
资源大小:986k
文件大小:2k
源码类别:
浏览器
开发平台:
Visual Basic
- Attribute VB_Name = "mFavMenu"
- '关于收藏夹的冬冬
- Option Explicit
- '收藏夹信息
- '项(url)信息
- Public Type typFavInfo
- Url As String
- Title As String
- path As String
- hSubMenu As Long
- hNode As Long
- End Type
- 'Public webUrl() As String
- Public favoriteInfo() As typFavInfo
- Public itemMenuCount As Long
- '目录信息
- Public Type subMenuInfo
- Title As String
- hwnd As Long
- path As String
- isLoadSub As Boolean
- hNode As Long 'treeview node handle
- End Type
- Public loadSubInfo() As subMenuInfo
- Public subMenuCount As Long
- Public Max_subMenuCount As Long
- Public Max_itemMenuCount As Long
- Public Const MaxMenuCharLength As Long = 30
- '整理收藏夹函数
- Public Declare Function DoOrganizeFavDlg Lib "shdocvw.dll" _
- (ByVal hwnd As Long, ByVal lpszRootFolder As String) As Long
- '动态菜单ID的偏移量
- Public Const MenuIDOffset As Long = 10000
- '收藏夹路径
- Public favoritePath As String
- '获得子菜单下对应的menuitem
- Public Sub GetItemFromSubMenu(hSubMenu&, Optional nItems As Collection)
- Dim i&
- If nItems Is Nothing Then
- Set nItems = New Collection
- End If
- For i = 1 To itemMenuCount
- If favoriteInfo(i).hSubMenu = hSubMenu Then
- nItems.Add i
- End If
- Next i
- End Sub
- '在一个窗口中显示所在层的链接
- Public Sub ShowFloatSubFav(hSubMenu&)
- Dim i&
- Dim tFloat As frmFloatSubFav
- Dim tTitle$
- Dim tItems As Collection
- 'Dim tPt&
- For i = 0 To subMenuCount
- If loadSubInfo(i).hwnd = hSubMenu Then
- tTitle = loadSubInfo(i).Title
- Exit For
- End If
- Next i
- Set tFloat = New frmFloatSubFav
- Load tFloat
- tFloat.Caption = tTitle
- Call GetItemFromSubMenu(hSubMenu, tItems)
- For i = 1 To tItems.Count
- tFloat.AddButton favoriteInfo(tItems(i)).Title, favoriteInfo(tItems(i)).Url
- Next i
- tFloat.Resize
- tFloat.SetPos
- tFloat.Show , gMainForm
- End Sub
- '打开所在层的所有链接
- Public Sub OpenAllLink(hSubMenu&)
- Dim i&
- For i = 1 To itemMenuCount
- If favoriteInfo(i).hSubMenu = hSubMenu Then
- gMainForm.NewWebbrowser favoriteInfo(i).Url
- End If
- Next i
- End Sub