MDIFrmMain.frm
资源名称:IE_VB.rar [点击查看]
上传用户:davilee3
上传日期:2015-04-22
资源大小:986k
文件大小:225k
源码类别:
浏览器
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.MDIForm MDIFrmMain
- AutoShowChildren= 0 'False
- BackColor = &H8000000C&
- ClientHeight = 5355
- ClientLeft = 330
- ClientTop = 825
- ClientWidth = 7800
- Icon = "MDIFrmMain.frx":0000
- LinkTopic = "MDIForm1"
- OLEDropMode = 1 'Manual
- ScrollBars = 0 'False
- Begin VB.PictureBox pctHoldStatus
- Align = 2 'Align Bottom
- BorderStyle = 0 'None
- Height = 375
- Left = 0
- ScaleHeight = 375
- ScaleWidth = 7800
- TabIndex = 14
- Top = 4980
- Width = 7800
- End
- Begin VB.Timer tmrAutoSave
- Interval = 1000
- Left = 4680
- Top = 3120
- End
- Begin VB.Timer tmrCheckTbr
- Enabled = 0 'False
- Interval = 500
- Left = 5160
- Top = 2640
- End
- Begin VB.PictureBox pctReBar
- Align = 1 'Align Top
- BorderStyle = 0 'None
- Height = 1575
- Left = 0
- ScaleHeight = 105
- ScaleMode = 3 'Pixel
- ScaleWidth = 520
- TabIndex = 4
- Top = 0
- Width = 7800
- Begin VB.ComboBox cmbSearch
- BeginProperty Font
- Name = "新宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 300
- Left = 4320
- OLEDropMode = 1 'Manual
- TabIndex = 13
- Top = 1020
- Width = 1275
- End
- Begin VB.PictureBox pctAddress
- BorderStyle = 0 'None
- Height = 330
- Left = 0
- ScaleHeight = 330
- ScaleWidth = 5610
- TabIndex = 7
- Top = 480
- Width = 5610
- Begin VB.PictureBox pctTurnBtn
- Height = 195
- Left = 3540
- ScaleHeight = 135
- ScaleWidth = 375
- TabIndex = 10
- Top = 60
- Width = 435
- End
- Begin VB.ComboBox cmbAdd
- BeginProperty Font
- Name = "新宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 300
- Left = 0
- OLEDropMode = 1 'Manual
- TabIndex = 1
- ToolTipText = "更多选项(Ctrl+Alt)"
- Top = 15
- Width = 3360
- End
- End
- Begin VB.PictureBox pctTabs
- BorderStyle = 0 'None
- Height = 300
- Left = 2160
- ScaleHeight = 300
- ScaleWidth = 6105
- TabIndex = 5
- Top = 120
- Width = 6105
- Begin VB.PictureBox pctTabGoLeft
- Height = 195
- Left = 300
- ScaleHeight = 135
- ScaleWidth = 255
- TabIndex = 11
- Top = 60
- Width = 315
- End
- Begin VB.PictureBox pctTabGoRight
- Height = 195
- Left = 4080
- ScaleHeight = 135
- ScaleWidth = 255
- TabIndex = 12
- Top = 60
- Width = 315
- End
- Begin VB.Frame fraHoldOpt
- BorderStyle = 0 'None
- Height = 300
- Left = 1620
- TabIndex = 6
- Top = 0
- Width = 2235
- Begin VB.PictureBox pctTabBar
- Height = 135
- Left = 0
- ScaleHeight = 75
- ScaleWidth = 315
- TabIndex = 9
- Top = 0
- Width = 375
- End
- End
- End
- End
- Begin VB.Timer timerMoveTab
- Enabled = 0 'False
- Interval = 500
- Left = 4680
- Top = 2640
- End
- Begin VB.PictureBox pctSideBar
- Align = 3 'Align Left
- BorderStyle = 0 'None
- Height = 3405
- Left = 0
- ScaleHeight = 3405
- ScaleWidth = 2595
- TabIndex = 0
- Top = 1575
- Visible = 0 'False
- Width = 2595
- Begin VB.PictureBox pctHoldFavorite
- Appearance = 0 'Flat
- BackColor = &H80000002&
- BorderStyle = 0 'None
- ForeColor = &H80000008&
- HasDC = 0 'False
- Height = 1995
- Left = 360
- ScaleHeight = 133
- ScaleMode = 3 'Pixel
- ScaleWidth = 125
- TabIndex = 15
- Top = 240
- Width = 1875
- Begin VB.PictureBox pctSideBandHold
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BorderStyle = 0 'None
- ForeColor = &H80000008&
- HasDC = 0 'False
- Height = 855
- Left = 300
- ScaleHeight = 57
- ScaleMode = 3 'Pixel
- ScaleWidth = 93
- TabIndex = 17
- Top = 1020
- Width = 1395
- End
- Begin VB.Label lblSideBand
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "收藏夹"
- BeginProperty Font
- Name = "宋体"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H8000000E&
- Height = 180
- Left = 120
- TabIndex = 16
- Top = 60
- Width = 540
- End
- End
- Begin VB.Frame fraMove
- BorderStyle = 0 'None
- Height = 1695
- Left = 0
- MousePointer = 9 'Size W E
- TabIndex = 8
- Top = 0
- Width = 60
- End
- Begin VB.Frame fraTitleButton
- BorderStyle = 0 'None
- Caption = "Frame1"
- Height = 615
- Left = 120
- TabIndex = 2
- Top = 3000
- Width = 615
- Begin VB.CommandButton cmdTray
- BeginProperty Font
- Name = "Tahoma"
- Size = 9
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 210
- Left = 0
- TabIndex = 3
- ToolTipText = "隐藏"
- Top = 0
- Width = 240
- End
- End
- End
- End
- Attribute VB_Name = "MDIFrmMain"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '---------------------------------------------------------------------------------------
- ' Module : MDIFrmMain
- ' DateTime : <<2005-7-22 23:05
- ' Author : Lingll
- ' Purpose : 程序主窗体
- '---------------------------------------------------------------------------------------
- Option Explicit
- '收藏夹菜单开始位置的偏移量
- Private Const FavoriteMenuPosOffset As Long = 5
- Private mIeAuto As cAutoComplete
- Public hMnuFavorite As Long
- Public hMnuMoreFav As Long
- Public hMnuReopen As Long
- 'Dim isLockPresentWeb As Boolean
- 'Dim tvwPopItemKey As String
- 'Dim tFocusV As Long
- Dim tabMoveDir As Integer
- Dim mWindowState As Integer
- Public proxyPop As Boolean
- Public pvnpopPop As Boolean 'pvnpop button pop menu
- Dim WithEvents mySysTray As cSysTray
- Attribute mySysTray.VB_VarHelpID = -1
- 'Const max_re_closepage As Integer = 10
- 'Dim re_closepage_count As Integer
- 'Dim t_tabmouseposX As Single
- 'Dim t_tabmouseposY As Single
- 'Dim dragSrcIndex As Integer
- 'Dim dragtabsimg As Picture
- Dim turntoX As Single, turntoY As Single, turntoCan As Boolean
- Dim turntoButtonDown As Boolean
- '===== 频繁(最近)使用的收藏 =============
- Private Type typMoreFavorite
- mark As Long
- url As String
- Title As String
- End Type
- Private moreFavorite() As typMoreFavorite
- Private moreFavOrder() As Long
- Private moreFavCount As Long
- Private moreFavMenuCount As Long
- '==================================
- Private m_ShowFavorite As Long 'MSComctlLib.ValueConstants
- ''====== 菜单图标在ImageList的Index ===========
- '
- 'Private Const ImageListIndex_Menu_Folder As Long = 1
- 'Private Const ImageListIndex_Menu_Url As Long = 2
- '================================================
- 'menu hwnd
- Private mHMenu As Long
- 'menu item count
- 'Private mMainMenuItemCount As Long
- Private mvTvwFavorite As cTvwFavorite
- ''下载控制按钮下拉菜单
- 'Private mBlockElementPopMenu As cPopMenu
- '自动过滤菜单
- Private mPopmnuAutoBlockPopwin As cPopMenu
- '系统托盘菜单
- Private mPopmnuSystray As cPopMenu
- '标签右键菜单
- Private mPopmnuTabpop As cPopMenu
- Private Const mIDM_Tabs_SetBottom& = 1
- Private Const mIDM_Tabs_Selected& = 2
- Private Const mIDM_Tabs_AddFavor& = 3
- Private Const mIDM_Tabs_AddUrlFilter& = 4
- Private Const mIDM_Tabs_CloseLeftPages& = 5
- Private Const mIDM_Tabs_CloseRightPages& = 6
- Private Const mIDM_Tabs_CloseLike& = 7
- Private Const mIDM_Tabs_Close& = 8
- '转到按钮菜单
- Private mPopmnuTurnTo As cPopMenu
- Private Const mIDM_Turnto_TT& = 101
- Private Const mIDM_Turnto_GoUp& = 102
- Private Const mIDM_Turnto_NewTab& = 103
- Private Const mIDM_Turnto_NewIE& = 104
- Private Const mOffset_Turnto& = 200
- 'Mdi主窗口中间那块东西的句柄
- Public hMDIClient As Long
- 'mousedown时点击的是哪个tab
- Private mMouseDownTabIndex As Long
- '============ rebar band id ==================
- Private Const ID_Band_MainMenu As Long = 200
- Private Const ID_Band_MainTbr As Long = 101
- Private Const ID_Band_Address As Long = 102
- Private Const ID_Band_Tabs As Long = 103
- Private Const ID_Band_SmallTbr As Long = 104
- Private Const ID_Band_SearchTbr As Long = 105
- '============================================
- ''主工具栏Hwnd
- 'Private mHwndTbrMain As Long
- ''小工具栏hwnd
- 'Private mTbrOtherHwnd As Long
- ''搜索栏toolbar hwnd
- 'Private mTbrSearchHwnd As Long
- '暂存窗口标题,用于全屏时暂存
- Private mTempCaption As String
- '页面标签数据
- Private Const mTabWidth As Long = 97
- Private Const mTabHeight As Long = 20
- Private WithEvents TabBar As cButtonBar
- Attribute TabBar.VB_VarHelpID = -1
- Private downButton As cButton
- Private downX&, downY&
- '转到按钮
- Private Const mTrnToBtnWidth As Long = 32
- Private Const mTrnToBtnHeight As Long = 22
- Private WithEvents TrnToBtnBar As cButtonBar
- Attribute TrnToBtnBar.VB_VarHelpID = -1
- '标签向左|向右按钮
- Private Const mTabGoLRWidth As Long = 22
- Private Const mTabGoLRHeight As Long = 22
- Private WithEvents TabGoLeftBar As cButtonBar
- Attribute TabGoLeftBar.VB_VarHelpID = -1
- Private WithEvents TabGoRightBar As cButtonBar
- Attribute TabGoRightBar.VB_VarHelpID = -1
- '临时存放搜索栏的文字
- 'Private mSearchWordBff As String
- '搜索文字是否已经改变
- Private mSearchWordChanged As Boolean
- '用类生成的toolbar
- Private WithEvents mcTbrSearch As cToolBar
- Attribute mcTbrSearch.VB_VarHelpID = -1
- Private WithEvents mcTbrMainMenu As cToolBar
- Attribute mcTbrMainMenu.VB_VarHelpID = -1
- '====== 模拟菜单的相关变量 ========
- Private Type NMHDR
- hwndFrom As Long
- idfrom As Long
- code As Long
- End Type
- Private Type NMTOOLBAR_id
- hdr As NMHDR
- iItem As Long
- End Type
- 'Private Const TBN_FIRST As Long = (-700)
- 'Private Const TBN_DROPDOWN As Long = (TBN_FIRST - 10)
- 'Private Const WM_NOTIFY As Long = &H4E
- '
- Private mDropdownId&
- Private mPopId&
- 'Private mPrex&, mPrey&
- Private mInHotTack As Boolean
- Private mInDropDown As Boolean
- Private mSelectedMenu As Long
- 'Private mSelectedItem As Long
- Private mSelectedIsSubmenu As Boolean
- Private mDropMenuHwnd As Long
- Private mDropDownPressMenu As Boolean
- Private mCanTrackPopMenu As Boolean
- '=====================================
- 'rebar
- Public WithEvents m_cRebar As cRebar
- Attribute m_cRebar.VB_VarHelpID = -1
- 'status bar
- Private m_cSsbar As cStatusbar32
- 'favorite tree
- Public m_cTvwFav As cTreeView32
- Attribute m_cTvwFav.VB_VarHelpID = -1
- 'favorite tree toolbar
- Public WithEvents m_cTbrSidebar As cToolBar
- Attribute m_cTbrSidebar.VB_VarHelpID = -1
- 'small toolbar
- Public WithEvents m_cTbrSmall As cToolBar
- Attribute m_cTbrSmall.VB_VarHelpID = -1
- 'main toolbar
- Public WithEvents m_cTbrMain As cToolBar
- Attribute m_cTbrMain.VB_VarHelpID = -1
- ''监视文件变化,用于收藏夹
- 'Private WithEvents m_cSNof As cNotifyChange
- '初始化"标签栏"按钮
- Private Sub IniTabBar()
- pctTabBar.Left = 0: pctTabBar.Top = 0
- pctTabBar.DragIcon = dragCursor
- Set TabBar = New cButtonBar
- With TabBar
- .IniMe pctTabBar
- .ButtonWidth = mTabWidth
- .ButtonHeight = mTabHeight
- End With
- End Sub
- '初始化"转到"按钮
- Private Sub IniTrunToButton()
- Dim tBtn As cButton
- Set TrnToBtnBar = New cButtonBar
- With TrnToBtnBar
- .IniMe pctTurnBtn
- .ButtonWidth = mTrnToBtnWidth
- .ButtonHeight = mTrnToBtnHeight
- Set tBtn = .Add()
- tBtn.RightBorder = False
- Set tBtn.ImageNormal = LoadImageEx(107, "gif")
- tBtn.TipTitle = "转到"
- tBtn.tiptext = "拖动鼠标有更多选项"
- End With
- End Sub
- '初始化 向左|向右按钮
- Private Sub IniTabGoButton()
- Dim tImg As cImgEx
- Dim tDskDc&
- tDskDc = GetDC(0)
- Set tImg = New cImgEx
- tImg.Create 64, 16, tDskDc
- tImg.CopyByBmp LoadImageEx(IDB_TabGoLR, "gif").handle
- ReleaseDC 0, tDskDc
- Dim tBtn As cButton
- Set TabGoLeftBar = New cButtonBar
- pctTabGoLeft.Top = 0
- pctTabGoLeft.Left = 0
- With TabGoLeftBar
- .IniMe pctTabGoLeft
- .ButtonWidth = mTabGoLRWidth
- .ButtonHeight = mTabGoLRHeight
- Set tBtn = .Add()
- End With
- With tBtn
- .RightBorder = False
- Set .ImageOver = tImg.ExtractImg2(16, 16, 0)
- Set .ImageNormal = tImg.ExtractImg2(16, 16, 1) ' LoadImageEx(IDI_TabGoLeft_Gary, "icon2")
- End With
- Set tBtn = Nothing
- Set TabGoRightBar = New cButtonBar
- pctTabGoRight.Top = 0
- With TabGoRightBar
- .IniMe pctTabGoRight
- .ButtonWidth = mTabGoLRWidth
- .ButtonHeight = mTabGoLRHeight
- Set tBtn = .Add()
- End With
- With tBtn
- .RightBorder = False
- Set .ImageOver = tImg.ExtractImg2(16, 16, 2) 'LoadImageEx(IDI_TabGoRight, "icon2")
- Set .ImageNormal = tImg.ExtractImg2(16, 16, 3) 'LoadImageEx(IDI_TabGoRight_Gray, "icon2")
- End With
- Set tBtn = Nothing
- End Sub
- Public Sub CheckTab(index&)
- TabBar.CheckRadioButton index
- End Sub
- '
- Private Sub cmbAdd_Click()
- Call OpenAddressUrl(True)
- 'If loadedBrowserCount > 0 Then
- ' webbState(gActiveWebIndex).webForm.Navigate cmbAdd.Text, False
- 'Else
- ' Call NewWebbrowser(cmbAdd.Text)
- 'End If
- End Sub
- Private Sub cmbAdd_GotFocus()
- addbarGetFocus = True
- turntoButtonDown = False
- If loadedBrowserCount > 0 Then
- Call webbState(gActiveWebIndex).webForm.Release
- End If
- End Sub
- Private Sub cmbAdd_KeyDown(KeyCode As Integer, Shift As Integer)
- Dim tXY As POINTAPI, tRc As RECT
- If KeyCode = vbKeyReturn Then
- Select Case Shift
- Case 0
- Call ShortKeyGoto(AddBarShortKey_Enter)
- Case vbShiftMask
- Call ShortKeyGoto(AddBarShortKey_Shift)
- Case vbCtrlMask
- Call ShortKeyGoto(AddBarShortKey_Ctrl)
- Case vbAltMask
- Call ShortKeyGoto(AddBarShortKey_Alt)
- Case vbCtrlMask + vbShiftMask
- Call ShortKeyGoto(AddBarShortKey_CtrlShift)
- Case vbAltMask + vbShiftMask
- Call ShortKeyGoto(AddBarShortKey_AltShift)
- End Select
- Else
- If Shift = vbAltMask + vbCtrlMask Then
- GetWindowRect cmbAdd.hWnd, tRc
- tXY.x = tRc.Left: tXY.y = tRc.Bottom
- 'Call ScreenToClient(Me.hwnd, tXY)
- 'Me.PopupMenu mnuTurnto, 0, tXY.x * 15, tXY.y * 15
- Call DoTurntoMenu(mPopmnuTurnTo.Popup(False, tXY.x, tXY.y))
- End If
- End If
- End Sub
- '打开地址栏地址
- Private Sub OpenAddressUrl(newtab As Boolean, Optional AddList As Boolean = True, Optional vUrl$)
- 'If AddList Then cmbAdd.AddItem cmbAdd.Text
- Dim tstr$
- If LenB(vUrl) = 0 Then
- tstr = cmbAdd.Text
- Else
- tstr = vUrl
- End If
- If AddList Then AddAddbarUrl tstr
- If loadedBrowserCount <= 0 Then newtab = True
- If newtab Then
- Call NewWebbrowser(tstr)
- Else
- webbState(gActiveWebIndex).webForm.Navigate tstr, False
- End If
- End Sub
- '响应地址栏键盘组合
- Private Sub ShortKeyGoto(nID As Long)
- If nID > 0 Then
- If nID <= SearchurlCount Then
- Call ReplaceAddress(nID)
- End If
- Else
- Select Case nID
- Case -4 '当前页
- Call OpenAddressUrl(False)
- ' If loadedBrowserCount > 0 Then
- ' webbState(gActiveWebIndex).webForm.Navigate cmbAdd.Text, False
- ' Else
- ' Call NewWebbrowser(cmbAdd.Text)
- ' End If
- Case -3 '上一级
- Case -2 '新建页
- Call OpenAddressUrl(True)
- 'Call NewWebbrowser(cmbAdd.Text)
- Case -1 '打开ie
- Call NewIE(cmbAdd.Text)
- Case 0
- 'do nothing
- End Select
- End If
- End Sub
- Private Sub cmbAdd_LostFocus()
- If Not turntoButtonDown Then addbarGetFocus = False
- End Sub
- Private Sub cmbAdd_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
- If Data.GetFormat(vbCFText) Then
- cmbAdd.Text = Data.GetData(vbCFText)
- End If
- End Sub
- Private Sub cmbSearch_Change()
- mSearchWordChanged = True
- End Sub
- Private Sub cmbSearch_GotFocus()
- If loadedBrowserCount > 0 Then
- Call webbState(gActiveWebIndex).webForm.Release
- End If
- End Sub
- Private Sub cmbSearch_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn Then
- If gSearchEgnCount > 0 Then
- If gDefaultEgn < 0 Or gDefaultEgn > gSearchEgnCount Then
- gDefaultEgn = 1
- End If
- Call OpenSearchPage(gDefaultEgn)
- End If
- ElseIf Shift = vbAltMask + vbCtrlMask Then
- Call PopSearchMenu
- End If
- End Sub
- Private Sub cmbSearch_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
- If Data.GetFormat(vbCFText) Then
- cmbSearch.Text = Data.GetData(vbCFText)
- End If
- End Sub
- '将搜索过的词添加进列表
- Private Sub AddSearchList(ByVal vKey$)
- Dim i&, tcnt&
- If mSearchWordChanged Then
- tcnt = cmbSearch.ListCount
- vKey = Trim(vKey)
- For i = 0 To tcnt - 1
- If vKey = cmbSearch.List(i) Then
- cmbSearch.RemoveItem i
- Exit For
- End If
- Next i
- cmbSearch.AddItem vKey, 0
- If cmbSearch.ListCount > 20 Then
- cmbSearch.RemoveItem cmbSearch.ListCount - 1
- End If
- mSearchWordChanged = False
- End If
- End Sub
- Private Sub cmdTray_Click()
- Call ShowMe(False)
- End Sub
- 'Private Sub m_cSNof_Change(eId As SHChangeNotifications.SHCN_EventIDs, path1 As String, path2 As String)
- 'Select Case eId
- ' Case SHCNE_RENAMEITEM, SHCNE_CREATE, SHCNE_DELETE, _
- ' SHCNE_MKDIR, SHCNE_RMDIR, SHCNE_UPDATEDIR, SHCNE_UPDATEITEM
- '
- ' If InStr(1, path1, favoritePath, vbTextCompare) Then
- ' Debug.Print eId
- ' Debug.Print "change", path1, path2
- ' Call RefreshFavorite
- ' End If
- 'End Select
- 'End Sub
- Private Sub m_cRebar_ChevronPushed(id As Long, index As Long, cLeft As Long, cTop As Long, cRight As Long, cBottom As Long)
- Select Case id
- Case ID_Band_MainMenu
- Call ShowHidenPart_MainMenu(cLeft, cBottom)
- Case ID_Band_SmallTbr
- 'Call ShowHidenPart_SmallTbr(cLeft, cBottom)
- End Select
- End Sub
- '---------------------------------------------------------------------------------------
- ' Procedure : ShowHidenPart_MainMenu
- ' DateTime : 2005-8-3 01:17
- ' Author : Lingll
- ' Purpose :
- '---------------------------------------------------------------------------------------
- Private Sub ShowHidenPart_MainMenu(cLeft&, cBottom&)
- Dim tPop As cPopMenu
- Dim tcnt&, i&
- Dim tbrW&, tRight&, tMaskedIndex&
- tcnt = mcTbrMainMenu.ButtonCount
- tbrW = mcTbrMainMenu.GetToolbarWidth
- tMaskedIndex = 0
- For i = tcnt - 1 To 0 Step -1
- mcTbrMainMenu.GetBtnRect mcTbrMainMenu.GetButton(i, False), _
- , , tRight
- If tRight <= tbrW Then
- tMaskedIndex = i + 1
- Exit For
- End If
- Next i
- If tMaskedIndex < tcnt And tMaskedIndex >= 0 Then
- Set tPop = New cPopMenu
- tPop.Create
- mMainMenu.SetMenuPosStyle tPop.hWnd
- tcnt = GetMenuItemCount(gHMainMenu)
- For i = tMaskedIndex To tcnt - 1
- tPop.Add GetMenuTextVb(gHMainMenu, i), pmsString Or pmsPopup, GetSubMenu(gHMainMenu, i)
- Next i
- tPop.Popup2 Me.hWnd, False, cLeft, cBottom, TPM_LEFTALIGN
- tPop.RemoveItems 0, tPop.GetItemCount - 1
- End If
- End Sub
- ''---------------------------------------------------------------------------------------
- '' Procedure : ShowHidenPart_SmallTbr
- '' DateTime : 2005-8-3 16:44
- '' Author : Lingll
- '' Purpose :
- ''---------------------------------------------------------------------------------------
- 'Private Sub ShowHidenPart_SmallTbr(cLeft&, cBottom&)
- 'On Error Resume Next
- '
- 'Dim tPop As cPopMenu
- 'Dim tcnt&, i&
- 'Dim tbrW&, tRight&, tMaskedIndex&
- 'Dim tArr() As String
- '
- 'tcnt = m_cTbrSmall.ButtonCount
- 'tbrW = m_cTbrSmall.GetToolbarWidth
- 'tMaskedIndex = 0
- 'For i = tcnt - 1 To 0 Step -1
- ' m_cTbrSmall.GetBtnRect m_cTbrSmall.GetButton(i, False), _
- ' , , tRight
- ' If tRight <= tbrW Then
- ' tMaskedIndex = i + 1
- ' Exit For
- ' End If
- 'Next i
- '
- '
- 'If tMaskedIndex < tcnt And tMaskedIndex >= 0 Then
- ' Set tPop = New cPopMenu
- ' tPop.Create
- ' tArr = m_cTbrSmall.p_colBff("desarr")
- '
- ' Dim tId&, tId2&
- ' For i = tMaskedIndex To tcnt - 1
- ' tId = m_cTbrSmall.GetButton(i, False)
- ' Select Case tId
- ' Case TbrID_Small_Close
- ' tPop.Add tArr(i), pmsPopup, m_cTbrSmall.p_colBff("close").hWnd
- ' Case TbrID_Small_Max
- ' tPop.Add tArr(i), pmsPopup, m_cTbrSmall.p_colBff("max").hWnd
- ' Case Else
- ' tPop.Add tArr(i), , tId + 1000
- ' End Select
- ' Next i
- ' tId2 = tPop.Popup2(Me.hWnd, False, cLeft, cBottom)
- ' If tId2 > 1000 Then
- ' Call m_cTbrSmall_ButtonClick(tId2 - 1000)
- ' Else
- ' ' Call m_cTbrSmall_ButtonClick(tId2 - 1000)
- ' End If
- ' tPop.RemoveItems 0, tPop.GetItemCount - 1
- 'End If
- '
- 'End Sub
- Private Sub m_cRebar_HeightChange(cy As Long)
- pctReBar.height = cy * Screen.TwipsPerPixelY
- End Sub
- Private Sub m_cTbrMain_ButtonClick(id As Long)
- On Error Resume Next
- Dim tFrm As frmBrowser
- If loadedBrowserCount > 0 Then
- Set tFrm = webbState(gActiveWebIndex).webForm
- End If
- Select Case id
- Case TbrID_Main_New
- Call mnuNewB_Click
- Case TbrID_Main_Back
- tFrm.webMe.goback
- Case TbrID_Main_Forward
- tFrm.webMe.goforward
- Case TbrID_Main_Stop
- tFrm.webMe.Stop
- Case TbrID_Main_Refresh
- tFrm.RefreshWeb
- Case TbrID_Main_Proxy
- 'mnuNoProxy.Checked = Not mnuNoProxy.Checked
- Call mnuNoProxy_Click
- Case TbrID_Main_AutoPreventPop
- If loadedBrowserCount > 0 Then
- If (m_cTbrMain.GetButtonState(id) And TBSTATE_CHECKED) <> 0 Then
- Call m_cTbrMain.CheckButton(id, False)
- tFrm.mPvnPop = 0
- Else
- Call m_cTbrMain.CheckButton(id, True)
- tFrm.mPvnPop = 2
- End If
- End If
- Case TbrID_Main_Favorites
- If (m_cTbrMain.GetButtonState(id) And TBSTATE_CHECKED) <> 0 Then
- Call m_cTbrMain.CheckButton(id, False)
- Me.ShowFavorite = 0
- Else
- Call m_cTbrMain.CheckButton(id, True)
- Me.ShowFavorite = IDM_Main_View_SideBand_Favorite
- End If
- ' Case TbrK_Main_FontSize
- ' Button.Value = tbrPressed
- ' Call ShowFontSizeMenu
- ' 'Me.PopupMenu mnuFontSize
- ' Button.Value = tbrUnpressed
- Case TbrID_Main_Reopen
- If ClosedPages.Count > 0 Then
- Call NewWebbrowser(ClosedPages.GetLastUrl)
- End If
- ' Case TbrID_Main_DLCtrl
- ' If loadedBrowserCount > 0 Then
- ' Button.Value = tbrPressed
- ' Call ShowBlockElementMenu
- ' Button.Value = tbrUnpressed
- ' End If
- Case TbrID_Main_Option
- frmOption.Show 0, Me
- Case TbrID_Main_FullScreen
- gFullScreenMode = True ' Not gFullScreenMode
- 'mnuView_FullScreen.Checked = gFullScreenMode
- Call FullScreen(gFullScreenMode)
- End Select
- End Sub
- Private Sub m_cTbrMain_DropDown(id As Long, bLeft As Long, bTop As Long, bRight As Long, bBottom As Long)
- Dim tPop As cPopMenu
- Dim tId&
- Select Case id
- Case TbrID_Main_Proxy
- pMnu_Proxy.SetDefault IDM_Main_Tools_Proxy_Nouse
- pMnu_Proxy.Popup2 Me.hWnd, False, bLeft, bBottom, TPM_LEFTALIGN
- pMnu_Proxy.SetDefault -1, False
- Case TbrID_Main_Favorites
- pMnu_MoreFavorite.Popup2 Me.hWnd, False, bLeft, bBottom, TPM_LEFTALIGN
- Case TbrID_Main_AutoPreventPop
- If loadedBrowserCount > 0 Then
- If webbState(gActiveWebIndex).webForm.mPvnPop > 0 Then
- mPopmnuAutoBlockPopwin.CheckRadioItem webbState(gActiveWebIndex).webForm.mPvnPop - 1, False
- Else
- mPopmnuAutoBlockPopwin.UnCheckAll
- End If
- tId = mPopmnuAutoBlockPopwin.Popup2(Me.hWnd, False, bLeft, bBottom)
- If tId > 0 Then
- webbState(gActiveWebIndex).webForm.mPvnPop = tId - 100
- Call m_cTbrMain.CheckButton(id, True)
- End If
- End If
- Case TbrID_Main_New
- Set tPop = m_cTbrMain.p_colBff("new")
- tPop.EnableItem 2, loadedBrowserCount > 0 '当前页
- tPop.EnableItem 5, loadedBrowserCount > 0 'ie打开当前页
- tId = tPop.Popup2(Me.hWnd, False, bLeft, bBottom)
- Select Case tId
- Case 1 '"newblankpage"
- Call mnuNewB_Click
- Case 2 '"newpresentpage"
- If loadedBrowserCount > 0 Then
- Call NewWebbrowser(webbState(gActiveWebIndex).webForm.GetWebUrl)
- End If
- Case 3 '"newclipboard"
- Call OpenClipboardUrl
- Case 4 '"newIEblank"
- Call NewIE
- Case 5 '"newIEpresent"
- If loadedBrowserCount > 0 Then
- Call NewIE(webbState(gActiveWebIndex).webForm.GetWebUrl)
- End If
- End Select
- Case TbrID_Main_DLCtrl
- If loadedBrowserCount > 0 Then
- 'Call ShowBlockElementMenu(bLeft, bBottom)
- pMnu_DlCtl.Popup2 Me.hWnd, False, bLeft, bBottom, TPM_LEFTALIGN
- End If
- Case TbrID_Main_FontSize
- If loadedBrowserCount > 0 Then
- pMnu_FontSize.Popup2 Me.hWnd, False, bLeft, bBottom, TPM_LEFTALIGN
- End If
- Case TbrID_Main_Back
- If loadedBrowserCount > 0 Then
- Set tPop = m_cTbrMain.p_colBff("back")
- Call webbState(gActiveWebIndex).webForm. _
- SetHistoryButton(TLEF_RELATIVE_BACK, tPop)
- tId = tPop.Popup2(Me.hWnd, False, bLeft, bBottom)
- If tId > 0 Then
- Call webbState(gActiveWebIndex).webForm.WebGo(-tId)
- End If
- End If
- Case TbrID_Main_Forward
- If loadedBrowserCount > 0 Then
- Set tPop = m_cTbrMain.p_colBff("forward")
- Call webbState(gActiveWebIndex).webForm. _
- SetHistoryButton(TLEF_RELATIVE_FORE, tPop)
- tId = tPop.Popup2(Me.hWnd, False, bLeft, bBottom)
- If tId > 0 Then
- Call webbState(gActiveWebIndex).webForm.WebGo(tId)
- End If
- End If
- Case TbrID_Main_Option
- Call ShowOptionButtonMenu(bLeft, bBottom)
- Case TbrID_Main_Reopen
- 'Call ShowReopenButtonMenu(bLeft, bBottom)
- Call pMnu_Reopen.Popup2(Me.hWnd, False, bLeft, bBottom, TPM_LEFTALIGN)
- Case TbrID_Main_SideBand
- pMnu_ViewSideBand.Popup2 Me.hWnd, False, bLeft, bBottom, TPM_LEFTALIGN
- End Select
- End Sub
- Private Sub m_cTbrMain_RClick(x As Long, y As Long, id As Long)
- Call popMenuLockToolBar
- End Sub
- Private Sub m_cTbrSidebar_ButtonClick(id As Long)
- Select Case id
- Case 102
- Me.ShowFavorite = 0
- ' tlbMe.Buttons("favorites").Value = tbrUnpressed
- ' pctHoldFavorite.Visible = False
- ' 'Call rfsCtrlSta
- Case 101
- If (m_cTbrSidebar.GetButtonState(101) And TBSTATE_CHECKED) = 0 Then
- frmFloatFavorite.Show , Me
- pctSideBar.Visible = False
- 'fraMove.Visible = False
- SetParent pctHoldFavorite.hWnd, frmFloatFavorite.hWnd
- frmFloatFavorite.resizeFramFravorite Me
- FloatFavorite = 0
- Else
- frmFloatFavorite.Hide
- pctSideBar.Visible = True
- 'fraMove.Visible = True
- SetParent pctHoldFavorite.hWnd, pctSideBar.hWnd
- Call resizeFramFravorite
- FloatFavorite = 1
- End If
- End Select
- End Sub
- Private Sub m_cTbrSmall_ButtonClick(id As Long)
- On Error Resume Next
- Dim i As Long
- Dim tHwnd&
- Select Case id
- Case TbrID_Small_NextTab
- Call NextLastTab(True)
- Case TbrID_Small_LastTab
- Call NextLastTab(False)
- Case TbrID_Small_Close
- Call ClosePage
- Case TbrID_Small_LockPresent
- If (m_cTbrSmall.GetButtonState(id) And TBSTATE_CHECKED) = 0 Then
- isLockPresentWeb = 0
- Else
- isLockPresentWeb = 1
- End If
- Case TbrID_Small_LockNew
- If loadedBrowserCount > 0 Then
- If (m_cTbrSmall.GetButtonState(id) And TBSTATE_CHECKED) <> 0 Then
- webbState(gActiveWebIndex).webForm.IsAllOpenNew = 1
- Else
- webbState(gActiveWebIndex).webForm.IsAllOpenNew = 0
- End If
- End If
- Case TbrID_Small_Max
- If loadedBrowserCount > 0 Then
- Select Case webbState(gActiveWebIndex).webForm.WindowState
- Case vbNormal
- ShowWindow webbState(gActiveWebIndex).webForm.hWnd, SW_MAXIMIZE
- Case Else 'vbMaximized, vbMinimized
- ShowWindow webbState(gActiveWebIndex).webForm.hWnd, SW_RESTORE
- End Select
- End If
- Case TbrID_Small_Min
- If loadedBrowserCount > 0 Then
- If webbState(gActiveWebIndex).webForm.WindowState = vbMinimized Then
- ShowWindow webbState(gActiveWebIndex).webForm.hWnd, SW_RESTORE
- Else
- ShowWindow webbState(gActiveWebIndex).webForm.hWnd, SW_MINIMIZE
- End If
- End If
- End Select
- End Sub
- Private Sub m_cTbrSmall_DropDown(id As Long, bLeft As Long, bTop As Long, bRight As Long, bBottom As Long)
- Dim i&, tId&
- Dim tPop As cPopMenu
- Dim tCo As Collection
- Select Case id
- Case TbrID_Small_Close
- Set tPop = m_cTbrSmall.p_colBff("close")
- tId = tPop.Popup2(Me.hWnd, False, bLeft, bBottom)
- Select Case tId
- Case 104 'close
- Call ClosePage
- Case 101 'invert close
- If loadedBrowserCount > 1 Then
- If selectedTabsCount <= 0 Then
- Call UnloadBrowsers(1, webbState(gActiveWebIndex).TabBtn.index - 1)
- Call UnloadBrowsers(2, loadedBrowserCount)
- Else
- Call CloseMulTab(True)
- End If
- End If
- Case 102 'close like
- If loadedBrowserCount > 0 Then
- Call CloseLikeTabs(gActiveWebIndex)
- End If
- Case 103 'close all
- Call CloseAllTabs
- End Select
- Case TbrID_Small_Max
- Set tPop = m_cTbrSmall.p_colBff("max")
- tId = tPop.Popup2(Me.hWnd, False, bLeft, bBottom)
- Select Case tId
- Case 102 'max all
- NOExeActive = True
- Call GetWindowOrder(tCo)
- SendMessageLng hMDIClient, WM_SETREDRAW, 0&, ByVal 0&
- ' For i = lstOrder.ListCount - 1 To 0 Step -1
- ' BringWindowToTop webbState(lstOrder.List(i)).webForm.hwnd
- ' ShowWindow webbState(lstOrder.List(i)).webForm.hwnd, SW_MAXIMIZE
- ' Next i
- For i = tCo.Count To 1 Step -1
- BringWindowToTop tCo(i)
- ShowWindow tCo(i), SW_MAXIMIZE
- Next i
- SendMessageLng hMDIClient, WM_SETREDRAW, 1&, ByVal 0&
- RedrawWindow hMDIClient, ByVal 0&, 0&, _
- RDW_ALLCHILDREN Or RDW_UPDATENOW Or RDW_INVALIDATE Or RDW_FRAME
- NOExeActive = False
- Case 101 ' "restoreall"
- NOExeActive = True
- Call GetWindowOrder(tCo)
- SendMessageLng hMDIClient, WM_SETREDRAW, 0&, ByVal 0&
- ' For i = lstOrder.ListCount - 1 To 0 Step -1
- ' BringWindowToTop webbState(lstOrder.List(i)).webForm.hwnd
- ' ShowWindow webbState(lstOrder.List(i)).webForm.hwnd, SW_RESTORE
- ' Next i
- For i = tCo.Count To 1 Step -1
- 'BringWindowToTop tCo(i)
- ShowWindow tCo(i), SW_RESTORE
- Next i
- SendMessageLng hMDIClient, WM_SETREDRAW, 1&, ByVal 0&
- RedrawWindow hMDIClient, ByVal 0&, 0&, _
- RDW_ALLCHILDREN Or RDW_UPDATENOW Or RDW_INVALIDATE Or RDW_FRAME
- NOExeActive = False
- End Select
- End Select
- End Sub
- Private Sub m_cTbrSmall_RClick(x As Long, y As Long, id As Long)
- Call popMenuLockToolBar
- End Sub
- Private Sub mcTbrMainMenu_DropDown(id As Long, bLeft As Long, bTop As Long, bRight As Long, bBottom As Long)
- Call DoDropDown(id, bLeft, bBottom)
- End Sub
- Private Sub DoDropDown(id&, x&, y&)
- Dim tSub&, rtnId&
- tSub = GetSubMenu(gHMainMenu, id - 100)
- 'Call SetMainMenuState(id - 100)
- mcTbrMainMenu.SetButtonState id, TBSTATE_ENABLED Or TBSTATE_PRESSED
- mDropdownId = id
- mDropDownPressMenu = False
- Call SetMenuMsgHook
- mInDropDown = True
- mInHotTack = False
- mDropMenuHwnd = tSub
- rtnId = TrackPopupMenu(tSub, TPM_LEFTALIGN, x, y, 0&, Me.hWnd, ByVal 0&)
- mDropMenuHwnd = 0
- 'mInHotTack = False
- mInDropDown = False
- Call UnSetMenuMsgHook
- mDropdownId = -1
- mcTbrMainMenu.SetButtonState id, TBSTATE_ENABLED
- If mPopId <> id And mPopId > 0 Then
- Call DropMenu_EnuDropDown(mPopId)
- mPopId = -1
- End If
- End Sub
- Public Sub SubCls_WM_MENUCOMMAND(ByVal hMenu&, vPos&)
- Dim tId&
- '判断是否2k或以上,在98或me下,wm_menucommand有区别
- If gOver2K Then
- tId = GetMenuItemID(hMenu, vPos)
- Else
- hMenu = hMenuCurSelect
- tId = vPos And &HFFFF&
- End If
- Select Case hMenu
- Case pMnu_DlCtl.hWnd
- Call DoMnuClick_DlCtrl(tId)
- Case pMnu_ViewToolbar.hWnd
- Call DoMnuClick_ViewToolbar(tId)
- Case pMnu_ViewSideBand.hWnd
- Debug.Print "side band sub"
- Call DoMnuClick_SideBand(tId)
- Case pMnu_FontSize.hWnd
- Call DoMnuClick_FontSize(tId)
- Case pMnu_MoreFavorite.hWnd
- Call DoMnuClick_MoreFavorite(tId)
- Case pMnu_Reopen.hWnd
- Call DoMnuClick_Reopen(tId)
- ' Case pMnu_Plugin_Scripts.hwnd
- ' Call DoMnuClick_Plugin_Scripts(tId)
- ' Case pMnu_OuterTools.hwnd
- ' Call DoMnuClick_OuterTools(tId)
- Case pMnu_Plugins.hWnd
- Call DoMnuClick_Plugins(tId)
- Case pMnu_Proxy.hWnd
- Call DoMnuClick_Proxy(tId)
- Case pMnu_Windows.hWnd
- Call DoMnuClick_Windows(tId)
- Case Else
- Call MenuClick(tId, hMenu)
- End Select
- End Sub
- '---------------------------------------------------------------------------------------
- ' Procedure : DoMnuClick_DlCtrl
- ' DateTime : 2005-6-21 12:24
- ' Author : Lingll
- ' Purpose : page download control
- '---------------------------------------------------------------------------------------
- Private Sub DoMnuClick_DlCtrl(id&)
- Dim tFrm As frmBrowser
- Set tFrm = webbState(gActiveWebIndex).webForm
- 'With pMnu_DlCtl
- Debug.Print id
- Select Case id
- Case IDM_Main_Tabs_DlCtl_Image
- tFrm.DL_Image = Not tFrm.DL_Image
- Case IDM_Main_Tabs_DlCtl_Music
- tFrm.DL_BgSound = Not tFrm.DL_BgSound
- Case IDM_Main_Tabs_DlCtl_Video
- tFrm.DL_Video = Not tFrm.DL_Video
- Case IDM_Main_Tabs_DlCtl_Script
- tFrm.DL_Script = Not tFrm.DL_Script
- Case IDM_Main_Tabs_DlCtl_ActiveX
- tFrm.DL_ActiveX = Not tFrm.DL_ActiveX
- Case IDM_Main_Tabs_DlCtl_JavaApplet
- tFrm.DL_JavaApplet = Not tFrm.DL_JavaApplet
- Case IDM_Main_Tabs_DlCtl_DLActiveX
- tFrm.Dl_DlActiveX = Not tFrm.Dl_DlActiveX
- Case IDM_Main_Tabs_DlCtl_AllOn
- tFrm.Dl_EnableAll True
- Case IDM_Main_Tabs_DlCtl_AllOff
- tFrm.Dl_EnableAll False
- End Select
- 'End With
- End Sub
- 'font size menu
- Private Sub DoMnuClick_FontSize(id&)
- Select Case id
- Case IDM_Main_View_FontSize_1
- Call mnuFontSizeList_Click(0)
- Case IDM_Main_View_FontSize_2
- Call mnuFontSizeList_Click(1)
- Case IDM_Main_View_FontSize_3
- Call mnuFontSizeList_Click(2)
- Case IDM_Main_View_FontSize_4
- Call mnuFontSizeList_Click(3)
- Case IDM_Main_View_FontSize_5
- Call mnuFontSizeList_Click(4)
- End Select
- End Sub
- 'show toolbar
- Private Sub DoMnuClick_ViewToolbar(id)
- Select Case id
- Case IDM_Main_View_Toolbar_StdButton
- Call mnuShowButtonBar_Click
- Case IDM_Main_View_Toolbar_Address
- Call mnuShowAddressBar_Click
- Case IDM_Main_View_Toolbar_Searchbar
- Call mnuShowSearchBar_Click
- Case IDM_Main_View_Toolbar_Tabs
- Call mnuShowTabBar_Click
- Case IDM_Main_View_Toolbar_MinTbr
- Call mnuShowMintoolBar_Click
- Case IDM_Main_View_Toolbar_Status
- Call mnuShowStatusBar_Click
- Case IDM_Main_View_Toolbar_Custom
- Call mnuShowCustomToolbar_Click
- Case IDM_Main_View_Toolbar_Lock
- Call mnuViewLockToolBar_Click
- End Select
- End Sub
- 'more favorite
- Private Sub DoMnuClick_MoreFavorite(id&)
- Select Case id
- Case IDM_Main_Favorite_MoreFavs_Clear
- Call mnuFavorite_MoreFavs_Clear_Click
- Case Else
- Call OpenMoreFav(id)
- End Select
- End Sub
- '打开"最近访问的收藏"
- Private Sub OpenMoreFav(id&)
- Dim tIndex&
- tIndex = id - IdOffset_MoreFavorite
- If tIndex > 0 And tIndex <= moreFavCount Then
- With moreFavorite(tIndex)
- If .mark > -1 Then
- Call NewWebbrowser(.url)
- Call ClickFavorite(.Title, .url)
- End If
- End With
- End If
- End Sub
- 'reopen
- Private Sub DoMnuClick_Reopen(id&)
- Select Case id
- Case IDM_Main_Favorite_Reopen_More
- Call mnuFavorite_Reopen_more_Click
- Case Else
- Call OpenReopen(id)
- End Select
- End Sub
- '打开最近关闭
- Private Sub OpenReopen(id&)
- Dim tIndex&
- Debug.Print id
- tIndex = id - IdOffset_Reopen
- If tIndex > 0 And tIndex <= ClosedPages.Count Then
- Call NewWebbrowser(ClosedPages.GetUrl(tIndex))
- End If
- End Sub
- ''script menu
- 'Private Sub DoMnuClick_Plugin_Scripts(id&)
- 'Select Case id
- ' Case IDM_Main_Tabs_Script_Reload
- ' Call mnuTabs_Scripts_Reload_Click
- ' Case IDM_Main_Tabs_Script_ViewFolder
- ' Call mnuTabs_Scripts_ViewFolder_Click
- ' Case Else
- ' Call RunScript_Menu(id)
- 'End Select
- 'End Sub
- 'Private Sub RunScript_Menu(id&)
- 'Dim tIndex&
- 'If loadedBrowserCount > 0 Then
- ' tIndex = id - IdOffset_Plugin_Script
- ' If tIndex > 0 And tIndex <= gScriptCnt Then
- '
- ' If Not gScripts(tIndex).LoadedScript Then
- ' Call LoadScriptFile2(gScripts(tIndex))
- ' End If
- ' webbState(gActiveWebIndex).webForm.RunScript gScripts(tIndex).Script, gScripts(tIndex).Language, gScripts(tIndex).RunType
- ' End If
- 'End If
- 'End Sub
- ''outer tools
- 'Private Sub DoMnuClick_OuterTools(id&)
- 'Select Case id
- ' Case IDM_Main_OuterTools_FlashgetDownload
- ' Call mnuOutTools_FlashgetDownload_Click
- ' Case Else
- ' Call RunOutertoolse_Menu(id)
- 'End Select
- 'End Sub
- ''运行外部工具(menu 方式点击)
- 'Private Sub RunOutertoolse_Menu(id&)
- 'On Error Resume Next
- 'Dim tIndex&
- 'Dim tPath$, tSysDir$
- 'Dim tParam$
- 'tIndex = id - IdOffset_OuterTools
- '
- 'If tIndex > 0 And tIndex <= ExToolsCount Then
- '
- ' tPath = LCase(ExTools(tIndex).path)
- ' tPath = Replace(tPath, "%app%", App.path)
- ' tPath = Replace(tPath, "%windir%", Environ("windir"))
- '
- ' If InStr(tPath, "%system%") > 0 Then
- ' If IsWinNT() Then
- ' tSysDir = Environ("windir") & "system32"
- ' Else
- ' tSysDir = Environ("windir") & "system"
- ' End If
- ' tPath = Replace(tPath, "%system%", tSysDir)
- ' End If
- '
- ' tParam = ExTools(tIndex).Param
- ' If loadedBrowserCount > 0 Then
- ' tParam = Replace(tParam, "%url%", webbState(gActiveWebIndex).webForm.GetWebUrl, , , vbTextCompare)
- ' tParam = Replace(tParam, "%WebWinHwnd%", webbState(gActiveWebIndex).webForm.hwnd, , , vbTextCompare)
- ' Else
- ' tParam = Replace(tParam, "%url%", "", , , vbTextCompare)
- ' tParam = Replace(tParam, "%WebWinHwnd%", "", , , vbTextCompare)
- ' End If
- '
- ' ShellExecute 0&, "open", tPath, _
- ' tParam, tPath, SW_SHOW
- 'End If
- 'End Sub
- 'plugins
- Private Sub DoMnuClick_Plugins(id&)
- On Error Resume Next
- Dim tIndex&
- tIndex = id - IdOffset_Plugins
- 'Debug.Print "domnuclick_plguins:", tIndex
- If id = IDM_Main_OuterTools_FlashgetDownload Then
- Call mnuOutTools_FlashgetDownload_Click
- Else
- If tIndex > 0 And tIndex <= gPluginCnt Then
- 'Debug.Print gPlugins(tIndex) Is Nothing
- Call gPlugins(tIndex).Run
- End If
- End If
- End Sub
- 'plugins -- sideband
- Private Sub DoMnuClick_SideBand(id&)
- On Error Resume Next
- ShowFavorite = id
- 'Dim tIndex&, i&
- 'Debug.Print "side band"
- 'tIndex = id - IdOffset_ViewSideBand
- '
- 'For i = 1 To gPluginSBCnt
- ' gPluginsSideBand(i).ShowBand False
- 'Next i
- '
- 'pMnu_ViewSideBand.UnCheckAll
- 'If id = IDM_Main_View_SideBand_Favorite Then
- ' m_cTvwFav.Visible = True
- ' lblSideBand.Caption = "收藏夹"
- ' pMnu_ViewSideBand.CheckItem IDM_Main_View_SideBand_Favorite, True
- 'Else
- ' If tIndex > 0 And tIndex <= gPluginSBCnt Then
- ' m_cTvwFav.Visible = False
- ' Call gPluginsSideBand(tIndex).ShowBand(True)
- ' lblSideBand.Caption = gPluginsSideBand(tIndex).Title
- ' pMnu_ViewSideBand.CheckItem id, True
- ' End If
- ' Call m_cTbrMain.CheckButton(TbrID_Main_Favorites, False)
- 'End If
- End Sub
- 'proxy
- Private Sub DoMnuClick_Proxy(id&)
- Select Case id
- Case IDM_Main_Tools_Proxy_Config
- Call mnuProxySetup_Click
- Case IDM_Main_Tools_Proxy_Nouse
- Call mnuNoProxy_Click
- Case IDM_Main_Tools_Proxy_UseieCfg
- Call mnuProxyIE_Click
- Case Else
- ProxySelected = id - IdOffset_Proxy
- Call ChangeProxy
- End Select
- End Sub
- 'windows
- Private Sub DoMnuClick_Windows(id&)
- On Error Resume Next
- Select Case id
- Case IDM_Main_Window_OpenNew
- Call mnuNewApp_Click
- Case IDM_Main_Window_Arrange_c
- Call mnuWindowArrange_Click(0)
- Case IDM_Main_Window_Arrange_h
- Call mnuWindowArrange_Click(1)
- Case IDM_Main_Window_Arrange_v
- Call mnuWindowArrange_Click(2)
- Case IDM_Main_Window_Arrange_a
- Call mnuWindowArrange_Click(3)
- Case Else
- BringWindowToTop webbState(id - IdOffset_Windows).webForm.hWnd
- End Select
- End Sub
- '处理dropdown menu 各项状态
- Private Sub SetMainMenuState(vSubMenuPos&)
- Dim tEnb As Boolean
- Select Case vSubMenuPos
- Case IDM_Main_Pos_File
- sMnuItm_Offline.CheckItem QueryOffline()
- Case IDM_Main_Pos_View
- tEnb = loadedBrowserCount > 0
- sMnuItm_Encode.EnableItem tEnb
- sMnuItm_ViewSource.EnableItem tEnb
- sMnuItm_Fontsize.EnableItem tEnb
- Case IDM_Main_Pos_Favorite
- sMnuItm_AddFavorite.EnableItem (loadedBrowserCount > 0)
- If Not loadSubInfo(0).isLoadSub Then
- 'Call SeedFile(favoritePath, loadSubInfo(0).hWnd, FavoriteMenuPosOffset, False)
- Call SeekFavoriteFolder(favoritePath, loadSubInfo(0).hWnd, FavoriteMenuPosOffset, False)
- loadSubInfo(0).isLoadSub = True
- End If
- Case IDM_Main_Pos_Tools
- Case IDM_Main_Pos_Tabs
- tEnb = loadedBrowserCount > 0
- sMnuItm_DlCtl.EnableItem tEnb
- sMnuItm_NoShowObj.EnableItem tEnb
- sMnuItm_NoShowFloat.EnableItem tEnb
- sMnuItm_ClearMouseLimit.EnableItem tEnb
- sMnuItm_AddFilter.EnableItem tEnb
- sMnuItm_PageZoom.EnableItem tEnb
- 'Case IDM_Main_Pos_OuterTools
- Case IDM_Main_Pos_Windows
- Call LoadWindowList
- Case IDM_Main_Pos_Help
- End Select
- End Sub
- Private Sub LoadWindowList()
- Dim tWlst() As Long, tWlst2() As Long
- Dim tBsCnt&
- Dim tVal&, tVal2&, tSwp&, tcnt&
- Dim i&, j&
- Call pMnu_Windows.RemoveItems(6, pMnu_Windows.GetItemCount() - 1)
- tBsCnt = loadedBrowserCount
- If tBsCnt > 0 Then
- ReDim tWlst(0 To tBsCnt - 1)
- ReDim tWlst2(0 To tBsCnt - 1)
- tcnt = 0
- For i = 1 To browserCount
- If Not webbState(i) Is Nothing Then
- tcnt = tcnt + 1
- tVal = webbState(i).TabBtn.index
- tVal2 = i
- For j = tBsCnt - 1 To tBsCnt - tcnt Step -1
- If tVal > tWlst(j) Then
- tSwp = tVal
- tVal = tWlst(j)
- tWlst(j) = tSwp
- tSwp = tVal2
- tVal2 = tWlst2(j)
- tWlst2(j) = tSwp
- End If
- Next j
- End If
- Next i
- pMnu_Windows.Add "", pmsSeparator
- For i = 0 To tBsCnt - 1
- If gActiveWebIndex = tWlst2(i) Then
- pMnu_Windows.Add webbState(tWlst2(i)).webForm.Caption, pmsChecked Or pmsString, IdOffset_Windows + tWlst2(i)
- Else
- pMnu_Windows.Add webbState(tWlst2(i)).webForm.Caption, pmsString, IdOffset_Windows + tWlst2(i)
- End If
- Next i
- End If
- 'Dim tHwnd&, tCnt&
- 'Call pMnu_Windows.RemoveItems(6, pMnu_Windows.GetItemCount() - 1)
- 'If loadedBrowserCount > 0 Then
- ' pMnu_Windows.Add "", pmsSeparator
- ' tHwnd = webbState(gActiveWebIndex).webForm.hwnd
- ' While tHwnd <> 0
- ' tCnt = tCnt + 1
- ' If tCnt <= 3 Then
- ' pMnu_Windows.Add GetWindowTextVb(tHwnd, 50)
- ' tHwnd = GetWindow(tHwnd, GW_HWNDNEXT)
- ' Else
- ' pMnu_Windows.Add "其他窗口(&M)..."
- ' tHwnd = 0
- ' End If
- ' Wend
- 'End If
- End Sub
- '处理菜单click事件
- Private Sub MenuClick(id&, hSubMenu&)
- Select Case id
- Case IDM_Main_File_NewBlank
- Call mnuNewB_Click
- Case IDM_Main_File_NewNew
- '(NA)
- Case IDM_Main_File_ClipNew
- Call mnuFileClipNew_Click
- Case IDM_Main_File_Open
- Call mnuOpen_Click
- Case IDM_Main_File_SaveAs
- Call mnuSaveAs_Click
- Case IDM_Main_File_CloseTab
- Call mnuCloseTab_Click
- Case IDM_Main_File_CloseAll
- Call mnuCloseAll_Click
- Case IDM_Main_File_ImportFavorite
- Call mnuFile_ImportFavorite_Click
- Case IDM_Main_File_ExportFavorite
- Call mnuFile_ExportFavorite_Click
- Case IDM_Main_File_SavePages
- Call mnuFile_SavePages_Click
- Case IDM_Main_File_LoadPages
- Call mnuFile_LoadPages_Click
- Case IDM_Main_File_Offline
- sMnuItm_Offline.CheckItem Not sMnuItm_Offline.GetCheckState()
- SetOffline sMnuItm_Offline.GetCheckState
- Case IDM_Main_File_Exit
- Call mnuExit_Click
- ' Case IDM_Main_View_Toolbar_StdButton
- ' Call mnuShowButtonBar_Click
- ' Case IDM_Main_View_Toolbar_Address
- ' Call mnuShowAddressBar_Click
- ' Case IDM_Main_View_Toolbar_Searchbar
- ' Call mnuShowSearchBar_Click
- ' Case IDM_Main_View_Toolbar_Tabs
- ' Call mnuShowTabBar_Click
- ' Case IDM_Main_View_Toolbar_MinTbr
- ' Call mnuShowMintoolBar_Click
- ' Case IDM_Main_View_Toolbar_Status
- ' Call mnuShowStatusBar_Click
- ' Case IDM_Main_View_Toolbar_Custom
- ' Call mnuShowCustomToolbar_Click
- ' Case IDM_Main_View_Toolbar_Lock
- ' Call mnuViewLockToolBar_Click
- ' Case IDM_Main_View_FontSize_1
- ' Call mnuFontSizeList_Click(0)
- ' Case IDM_Main_View_FontSize_2
- ' Call mnuFontSizeList_Click(1)
- ' Case IDM_Main_View_FontSize_3
- ' Call mnuFontSizeList_Click(2)
- ' Case IDM_Main_View_FontSize_4
- ' Call mnuFontSizeList_Click(3)
- ' Case IDM_Main_View_FontSize_5
- ' Call mnuFontSizeList_Click(4)
- Case IDM_Main_View_Encode_Gb
- Call mnuGb_Click
- Case IDM_Main_View_Encode_Big5
- Call mnuBig5_Click
- Case IDM_Main_View_ViewSource
- Call mnuViewSource_Click
- Case IDM_Main_View_ReloadFavorite
- Call mnuRefreshFavorite_Click
- Case IDM_Main_View_Hideme
- Call mnuViewHide_Click
- Case IDM_Main_View_FullScreen
- Call mnuView_FullScreen_Click
- Case IDM_Main_View_PageList
- Call mnuView_CloseWindowList_Click
- Case IDM_Main_Favorite_Add
- Call mnuAddFavorite_Click
- ' Case IDM_Main_Favorite_MoreFavs_Lists
- ' Case IDM_Main_Favorite_MoreFavs_Clear
- ' Call mnuFavorite_MoreFavs_Clear_Click
- ' Case IDM_Main_Favorite_Reopen_List
- ' Case IDM_Main_Favorite_Reopen_More
- ' Call mnuFavorite_Reopen_more_Click
- ' Case IDM_Main_Tools_Proxy_Config
- ' Call mnuProxySetup_Click
- ' Case IDM_Main_Tools_Proxy_Nouse
- ' Call mnuNoProxy_Click
- ' Case IDM_Main_Tools_Proxy_UseieCfg
- ' Call mnuProxyIE_Click
- ' Case IDM_Main_Tools_Proxy_ProxyList
- Case IDM_Main_Tools_OrganizeFav
- Call mnuOrganizeFav_Click
- Case IDM_Main_Tools_Option
- Call mnuOption_Click
- Case IDM_Main_Tools_IeOption
- Call mnuInternetOption_Click
- Case IDM_Main_Tools_CollectBoard
- Call mnuCollectBoard_Click
- Case IDM_Main_Tools_Slide
- Call mnuViewSlide_Click
- Case IDM_Main_Tabs_DlCtl_Image
- Case IDM_Main_Tabs_DlCtl_Music
- Case IDM_Main_Tabs_DlCtl_Video
- Case IDM_Main_Tabs_DlCtl_Script
- Case IDM_Main_Tabs_DlCtl_ActiveX
- Case IDM_Main_Tabs_DlCtl_JavaApplet
- Case IDM_Main_Tabs_DlCtl_AllOn
- Case IDM_Main_Tabs_DlCtl_AllOff
- Case IDM_Main_Tabs_NoShowObj
- Call mnuTabs_NoObject_Click
- Case IDM_Main_Tabs_NoShowFloat
- Call mnuTabs_NoFloat_Click
- Case IDM_Main_Tabs_ClearMouseLimit
- Call mnuClearMouseLimit_Click
- Case IDM_Main_Tabs_AddFilter
- Call mnuTabs_AddFilter_Click
- Case IDM_Main_Tabs_PageZoom_60
- Call mnuTabs_PageZoom_Item_Click(0)
- Case IDM_Main_Tabs_PageZoom_80
- Call mnuTabs_PageZoom_Item_Click(1)
- Case IDM_Main_Tabs_PageZoom_100
- Call mnuTabs_PageZoom_Item_Click(2)
- Case IDM_Main_Tabs_PageZoom_120
- Call mnuTabs_PageZoom_Item_Click(3)
- Case IDM_Main_Tabs_PageZoom_140
- Call mnuTabs_PageZoom_Item_Click(4)
- ' Case IDM_Main_Tabs_Script_List
- ' Case IDM_Main_Tabs_Script_Reload
- ' Call mnuTabs_Scripts_Reload_Click
- ' Case IDM_Main_Tabs_Script_ViewFolder
- ' Call mnuTabs_Scripts_ViewFolder_Click
- Case IDM_Main_Tabs_HidePage_Hide
- '(NA)
- Case IDM_Main_Tabs_HidePage_List
- '(NA)
- ' Case IDM_Main_OuterTools_List
- ' Case IDM_Main_OuterTools_FlashgetDownload
- ' Call mnuOutTools_FlashgetDownload_Click
- Case IDM_Main_Tabs_designModeOn
- If loadedBrowserCount > 0 Then
- webbState(gActiveWebIndex).webForm.SetDesignMode True
- End If
- Case IDM_Main_Tabs_designModeOff
- If loadedBrowserCount > 0 Then
- webbState(gActiveWebIndex).webForm.SetDesignMode False
- End If
- ' Case IDM_Main_Window_OpenNew
- ' Call mnuNewApp_Click
- ' Case IDM_Main_Window_Arrange_c
- ' Call mnuWindowArrange_Click(0)
- ' Case IDM_Main_Window_Arrange_h
- ' Call mnuWindowArrange_Click(1)
- ' Case IDM_Main_Window_Arrange_v
- ' Call mnuWindowArrange_Click(2)
- ' Case IDM_Main_Window_Arrange_a
- ' Call mnuWindowArrange_Click(3)
- Case IDM_Main_Help_History
- Call mnuHelp_history_Click
- Case IDM_Main_Help_HomePage
- Call mnuHelp_HomePage_Click
- Case IDM_Main_Help_Blog
- Call NewWebbrowser("http://blog.csdn.net/lingll/")
- Case IDM_Main_Help_About
- Call mnuAbout_Click
- Case IDM_Main_Help_Errlog
- Call mnuHelp_ErrorLog_Click
- Case Else
- If id >= IdOffset_MoreFavorite And id < IdOffset_Reopen Then
- Call OpenMoreFav(id)
- ElseIf id >= IdOffset_Reopen And id < IdOffset_Reopen + 50 Then
- Call OpenReopen(id)
- Else
- Call SubCls_COMMAND(id, hSubMenu)
- End If
- End Select
- End Sub
- Private Sub mcTbrMainMenu_RClick(x As Long, y As Long, id As Long)
- Call popMenuLockToolBar
- End Sub
- Private Sub mcTbrSearch_ButtonClick(id As Long)
- 'Dim i&
- Select Case id
- Case TbrID_Search_Search
- If gSearchEgnCount > 0 Then
- If gDefaultEgn < 0 Or gDefaultEgn > gSearchEgnCount Then
- gDefaultEgn = 1
- End If
- Call OpenSearchPage(gDefaultEgn)
- End If
- Case TbrID_Search_MulSearch
- If gMulSearchCount > 0 Then
- If gDefaultMulEgn <= 0 Or gDefaultMulEgn > gMulSearchCount Then
- gDefaultMulEgn = 1
- End If
- Call OpenMulSearchPage(gDefaultMulEgn)
- End If
- Case TbrID_Search_HeightLight
- If loadedBrowserCount > 0 Then
- webbState(gActiveWebIndex).webForm.HightLight (cmbSearch.Text)
- Call AddSearchList(cmbSearch.Text)
- End If
- Case TbrID_Search_Find
- If loadedBrowserCount > 0 Then
- webbState(gActiveWebIndex).webForm.FindWord (cmbSearch.Text)
- Call AddSearchList(cmbSearch.Text)
- End If
- End Select
- End Sub
- Private Sub mcTbrSearch_DropDown(id As Long, bLeft As Long, bTop As Long, bRight As Long, bBottom As Long)
- 'Dim tId&, i&
- 'Dim tpt As POINTAPI
- Select Case id
- Case TbrID_Search_MulSearch
- Call PopMulSearchMenu(True, bLeft, bBottom)
- Case TbrID_Search_Search
- Call PopSearchMenu(True, bLeft, bBottom)
- End Select
- End Sub
- Private Sub mcTbrSearch_OnSize(cx As Long, cy As Long)
- Dim tW&, tH&
- Dim tl&, tR&
- Dim sepWd&
- With mcTbrSearch
- .GetTbrMaxSize tW, tH
- .GetBtnRect 101, tl, , tR
- sepWd = tR - tl + cx - tW
- If sepWd < 30 Then sepWd = 30
- .SetButtonWidth 101, sepWd
- MoveWindow cmbSearch.hWnd, 0, 0, sepWd, cy, 1
- End With
- End Sub
- '更新TbrSearch布局
- Private Sub ResizeTbrSearch()
- Call mcTbrSearch_OnSize(mcTbrSearch.GetToolbarWidth(), _
- mcTbrSearch.GetToolbarHeight())
- End Sub
- Private Sub mcTbrSearch_OnToolTipText(id As Long, nText As String)
- Select Case id
- Case TbrID_Search_Search
- nText = "搜索"
- Case TbrID_Search_MulSearch
- nText = "多引擎搜索"
- ' Case 2
- ' nText = "高亮关键字"
- ' Case 3
- ' nText = "页面中查找(F3)"
- End Select
- End Sub
- Private Sub mcTbrSearch_RClick(x As Long, y As Long, id As Long)
- Call popMenuLockToolBar
- End Sub
- Private Sub MDIForm_Initialize()
- mMouseDownTabIndex = -1
- mSearchWordChanged = False
- tabsPos = 1
- isExit = False
- 'isLockPresentWeb = 0
- isTabClick = False
- isUnloadByFunction = False
- 'SaveWhenExit = 1
- Add_To_Fav_Is_On = False
- Max_itemMenuCount = 500
- Max_subMenuCount = 100
- meCaption = LoadResString(1101)
- ReDim webbState(0 To browserCount)
- 'webbState(0).isLoaded = True
- ReDim favoriteInfo(1 To Max_itemMenuCount)
- ReDim loadSubInfo(0 To Max_subMenuCount)
- 'load proxy data
- Call LoadProxy
- 'load setting
- Call LoadSettingsFromIni
- '=======================load favorite path============================
- 'Dim tmpReg As Object
- 'Set tmpReg = CreateObject("Wscript.Shell")
- 'favoritePath = tmpReg.regread("HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerShell FoldersFavorites")
- 'Dim tPath As String * MAX_PATH
- 'Call SHGetSpecialFolderPathW(0&, tPath, CSIDL_FAVORITES, 0)
- 'favoritePath = SysAllocString(StrPtr(tPath))
- Call CreateOptionPopmenu
- End Sub
- Private Sub MDIForm_Load()
- Dim i As Long
- fraHoldOpt.width = 0
- Call IniPopMenu
- '===============================================================
- '=================ini toolbar===================================
- '================================================================
- Call IniImglst
- Call IniToolbar
- If m_cTvwFav Is Nothing Then
- Call IniFavoriteTree
- End If
- '====== Set TvwFavorite ================
- Set mvTvwFavorite = New cTvwFavorite
- mvTvwFavorite.IniClass m_cTvwFav, Me
- '======================================
- On Error Resume Next
- '===================ini proxy=====================
- Call ReloadProxyMenu
- Call ChangeProxy
- '================================================
- 'Call LoadExToolsMenu
- mHMenu = gHMainMenu ' GetMenu(Me.hwnd)
- 'mMainMenuItemCount = GetMenuItemCount(mHMenu)
- Call LoadFavoriteMenu
- Call RefreshFavorite
- Me.Caption = meCaption
- SetParent fraTitleButton.hWnd, 0
- SetWindowLong fraTitleButton.hWnd, -8, Me.hWnd
- Set mySysTray = New cSysTray
- With mySysTray
- .pHwnd = pctReBar.hWnd
- .TrayIcon = LoadResPicture(101, vbResIcon)
- .TrayTip = Me.Caption
- End With
- gHW = Me.hWnd '取得本窗体指针
- Call mainHook(Me.hWnd) '调用钩子函数,将自制消息处理函数钩入Windows的消息循环
- Call IniRebar
- Call IniTabBar
- Call IniTrunToButton
- Call IniTabGoButton
- 'mTbrOtherHwnd = FindWindowEx(tlbOther.hwnd, 0&, "msvb_lib_toolbar", vbNullString)
- 'mTbrSearchHwnd = FindWindowEx(tbrSearch.hwnd, 0&, "msvb_lib_toolbar", vbNullString)
- 'mHwndTbrMain = FindWindowEx(tlbMe.hwnd, 0&, "msvb_lib_toolbar", vbNullString)
- hMDIClient = FindWindowEx(Me.hWnd, 0&, "MDIClient", vbNullString)
- '======== Global Input Hook ====================
- Call InstallKeyboardHook
- Call InstallMouseHook
- '=================加载"最近关闭页面"菜单==============
- 're_closepage_count = 0
- 'For i = 1 To max_re_closepage
- ' Load mnuRecent_ClosePage(i)
- ' mnuRecent_ClosePage(i).Visible = False
- ' mnuRecent_ClosePage(i).Enabled = True
- 'Next i
- Set mIeAuto = New cAutoComplete
- mIeAuto.Assign cmbAdd.hWnd, eSHACF_FILESYSTE Or eSHACF_URLALL Or eSHACF_USETAB Or eSHACF_AUTOSUGGEST_FORCE_ON
- Call LoadMoreFavInfo
- Call LoadSearchurlMenu
- Call EnableButtons
- 'Call LoadScriptMenu
- Call LoadPluginsMenu
- Call LoadPlugins_SideBand
- 'For i = 1 To gPluginSBCnt
- ' gPluginsSideBand(i).LoadSideBand
- ' gPluginsSideBand(i).SetSite pctSideBar.hWnd
- 'Next i
- 'Call RstMenu(pMnu_Option_Main.hwnd, IDP_Opt_UrlFilter, , ImageListIndex_Menu_Folder, 0)
- '"添加到收藏夹"
- Call gODrawMenu.RstMenu(hMnuFavorite, 0, , ImgIx_Icon_AddFav, , ImgIx_Icon_AddFav_Gray)
- '"最近访问"
- Call gODrawMenu.RstMenu(hMnuFavorite, 2, , ImgIx_Icon_FavFav)
- '"最近关闭"
- Call gODrawMenu.RstMenu(hMnuFavorite, 3, , ImgIx_Icon_Reopen)
- Call IniStatusBar
- 'Set m_cSNof = New cNotifyChange
- 'm_cSNof.Install Me.hwnd
- Call LoadAddUrlz
- If Command <> "" Then
- Call NewWebbrowser(Command)
- 'App.PrevInstance
- End If
- End Sub
- Private Sub MDIForm_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
- Dim i&
- If (Effect And 4) = 4 Then
- If Data.GetFormat(vbCFFiles) Then
- For i = 1 To Data.Files.Count
- Call NewWebbrowser(Data.Files(i))
- Next i
- ElseIf Data.GetFormat(vbCFText) Then
- Call NewWebbrowser(Data.GetData(vbCFText))
- End If
- End If
- End Sub
- Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
- If Add_To_Fav_Is_On Then Cancel = 1: Exit Sub
- isExit = True
- Call mainUnhook(Me.hWnd) '退出消息循环
- Call UninstallKeyboardHook
- Call UninstallMouseHook
- fraTitleButton.Visible = False
- SetParent fraTitleButton.hWnd, pctSideBar.hWnd
- 'Call rbUnhook(myRebar.hWnd)
- 'myRebar.DestroyRebar
- 'Set myRebar = Nothing
- SetParent cmbSearch.hWnd, pctReBar.hWnd
- 'save settings
- Call SaveSettingsToIni
- Call SaveAddUrlz
- Call SaveWindowState
- Me.Visible = False
- DestroyMenu gHMainMenu
- Set m_cRebar = Nothing
- Set mvTvwFavorite = Nothing
- Set m_cSsbar = Nothing
- Set m_cTvwFav = Nothing
- Set m_cTbrMain = Nothing
- Set m_cTbrSmall = Nothing
- Set m_cTbrSidebar = Nothing
- 'm_cSNof.UnInstall
- 'Set m_cSNof = Nothing
- Call UnloadPlugins
- End Sub
- Private Sub MDIForm_Terminate()
- End
- End Sub
- 'Private Sub MDIForm_Resize()
- ''If Me.WindowState = vbMinimized Then Exit Sub
- '''pctHoldFavorite.Height = Me.ScaleHeight
- ''Call rfsCtrlSta
- 'End Sub
- Private Sub MDIForm_Unload(Cancel As Integer)
- 'On Error Resume Next
- ''SetParent fraTitleButton.hwnd, pctHoldFavorite.hwnd
- '
- 'Call mainUnhook(Me.hWnd) '退出消息循环
- '
- ''rbUnhook myRebar.hWnd
- ''myRebar.DestroyRebar
- '
- ''Call tbrUnhook
- ''SMenus.Clear
- '
- 'Call UninstallKeyboardHook
- 'Call UninstallMouseHook
- '
- '
- ''save settings
- 'Call SaveSettingsToIni
- '
- 'Call SaveAddUrlz
- '
- 'Call UnloadPlugins
- End Sub
- Private Sub fraMove_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
- Call ReleaseCapture
- Call SendMessage(pctSideBar.hWnd, WM_SYSCOMMAND, SC_SIZE + 2, 0)
- Call resizeFramFravorite
- End Sub
- Private Sub mnuAbout_Click()
- MsgBox "L_E Browser Ver1.4 内部试用版" & Chr(13) & Chr(13) & _
- "1.4." & LTrim(Str(App.Revision)) & " build 050816" & Chr(13) & Chr(10) _
- & "2001.7 - 2005.8.16" & Chr(13) & Chr(13) _
- & "by lingll" & Chr(13) & Chr(13) _
- & "lingll2001@21cn.com" & Chr(13) & Chr(10) _
- & "http://lingll.yeah.net" & Chr(13) & Chr(10) & Chr(13) & Chr(10) _
- & "thx to 蔡主任 一直的支持" & Chr(13) & Chr(10) _
- & "thx to Yu Tang" _
- , vbOKOnly, meCaption
- End Sub
- Private Sub mnuAddFavorite_Click()
- Dim tmpFavorite As New ShellUIHelper
- Add_To_Fav_Is_On = True
- tmpFavorite.AddFavorite webbState(gActiveWebIndex).webForm.GetWebUrl, webbState(gActiveWebIndex).webForm.GetWebTitle
- Add_To_Fav_Is_On = False
- Call RefreshFavorite(0)
- End Sub
- Private Sub mnuBig5_Click()
- If loadedBrowserCount > 0 Then
- webbState(gActiveWebIndex).webForm.SetCharset "big5"
- End If
- 'Me.ActiveForm.webMe.Document.Charset = "big5"
- 'Me.ActiveForm.webMe.Refresh2
- End Sub
- Private Sub mnuClearMouseLimit_Click()
- On Error Resume Next
- If loadedBrowserCount > 0 Then
- Call webbState(gActiveWebIndex).webForm.ClearMouseLimit
- End If
- End Sub
- Private Sub mnuCloseAll_Click()
- Call CloseAllTabs
- End Sub
- Private Sub mnuCollectBoard_Click()
- 'frmCollectBoard.WindowState = 0
- frmCollectBoard.Show 0, Me
- End Sub
- Private Sub mnuFavorite_MoreFavs_Clear_Click()
- If MsgBox("确定清空?", vbOKCancel + vbQuestion, meCaption) = vbOK Then
- ReDim moreFavorite(0 To 0)
- ReDim moreFavOrder(0 To 0)
- moreFavCount = 0
- Call RefreshMoreFavMenu
- End If
- End Sub
- Private Sub mnuFavorite_Reopen_more_Click()
- frmSpPageList.Show , Me
- End Sub
- 'Private Sub mnuFile_Click()
- 'If loadedBrowserCount > 0 Then
- ' mnuSaveAs.Enabled = True
- ' mnuCloseTab.Enabled = True
- ' mnuCloseAll.Enabled = True
- 'Else
- ' mnuSaveAs.Enabled = False
- ' mnuCloseTab.Enabled = False
- ' mnuCloseAll.Enabled = False
- 'End If
- 'End Sub
- Private Sub mnuFile_ExportFavorite_Click()
- Dim tHobj As New ShellUIHelper
- tHobj.ImportExportFavorites False, ""
- End Sub
- Private Sub mnuFile_ImportFavorite_Click()
- Dim tHobj As New ShellUIHelper
- tHobj.ImportExportFavorites True, ""
- End Sub
- Private Sub mnuFile_LoadPages_Click()
- Call LoadPagez
- End Sub
- Private Sub mnuFile_SavePages_Click()
- Call SavePagez
- End Sub
- Private Sub mnuFileClipNew_Click()
- Call OpenClipboardUrl
- End Sub
- Private Sub mnuHelp_ErrorLog_Click()
- ErrorLog.ShowLog
- End Sub
- Private Sub mnuHelp_history_Click()
- 'frmWhatsNew.Show vbModal, Me
- Call NewWebbrowser(AppPath & "whats new.txt")
- End Sub
- Private Sub mnuHelp_HomePage_Click()
- Call NewWebbrowser("http://lingll.yeah.net")
- End Sub
- Private Sub mnuOutTools_FlashgetDownload_Click()
- frmFlashgetDownload.Show , Me
- End Sub
- 'Private Sub mnuOutToolsitems_Click(index As Integer)
- 'On Error Resume Next
- 'Dim tPath$, tSysDir$
- 'tPath = LCase(ExTools(index).path)
- 'tPath = Replace(tPath, "%app%", App.path)
- 'tPath = Replace(tPath, "%windir%", Environ("windir"))
- '
- 'If InStr(tPath, "%system%") > 0 Then
- ' If IsWinNT() Then
- ' tSysDir = Environ("windir") & "system32"
- ' Else
- ' tSysDir = Environ("windir") & "system"
- ' End If
- ' tPath = Replace(tPath, "%system%", tSysDir)
- 'End If
- 'Debug.Print Err.Description
- 'ShellExecute 0&, "open", tPath, _
- ' ExTools(index).Param, ExTools(index).path, SW_SHOW
- 'End Sub
- 'Private Sub mnuPopTabs_AddUrlFilter_Click()
- 'Call webbState(popWbbIdx).webForm.AddToUrlFilter
- 'End Sub
- '
- 'Private Sub mnuPopTabs_CloseLeft_Click()
- ''Call UnloadBrowsers(1, webbState(popWbbIdx).tabOrder - 1)
- 'Call UnloadBrowsers(1, webbState(popWbbIdx).TabBtn.index - 1)
- 'End Sub
- '
- 'Private Sub mnuPopTabs_CloseLike_Click()
- 'Call CloseLikeTabs(popWbbIdx)
- 'End Sub
- '
- 'Private Sub mnuPopTabs_CloseRight_Click()
- ''Call UnloadBrowsers(webbState(popWbbIdx).tabOrder + 1, loadedBrowserCount)
- 'Call UnloadBrowsers(webbState(popWbbIdx).TabBtn.index + 1, loadedBrowserCount)
- 'End Sub
- Private Sub mnuProxyIE_Click()
- Dim proxyMe As INTERNET_PROXY_INFO
- With proxyMe
- .dwAccessType = INTERNET_OPEN_TYPE_PRECONFIG
- .lpszProxy = ""
- .lpszProxyBypass = ""
- End With
- Call InternetSetOption(0&, INTERNET_OPTION_PROXY, proxyMe, Len(proxyMe))
- ProxySelected = 0
- Call ChangeProxy
- 'mnuProxyIE.Checked = True
- '
- 'If ProxySelected > 0 Then
- ' mnuProxyList(ProxySelected).Checked = False
- 'End If
- '
- End Sub
- 'Private Sub mnuRecent_ClosePage_Click(index As Integer)
- 'Call NewWebbrowser(mnuRecent_ClosePage(index).Tag)
- 'End Sub
- 'Private Sub mnuFileOffline_Click()
- 'mnuFileOffline.Checked = Not mnuFileOffline.Checked
- 'If mnuFileOffline.Checked Then
- ' gOffline = 1
- 'Else
- ' gOffline = 0
- 'End If
- 'End Sub
- 'Private Sub mnuLockCoolBar_Click()
- 'gLockToolBar = Not mnuLockCoolBar.Checked
- 'mnuLockCoolBar.Checked = gLockToolBar
- 'mnuViewLockToolBar.Checked = gLockToolBar
- 'myRebar.LockBands gLockToolBar
- 'End Sub
- Private Sub mnuNewApp_Click()
- Shell AppPath + App.EXEName
- End Sub
- Private Sub mnuOpen_Click()
- Dim nDlg As New OpenSaveDlg
- nDlg.Filter = "Html File(*.heml;*.htm)|*.heml;*.htm|All File|*.*"
- If nDlg.ShowOpen(Me.hWnd) Then
- Call NewWebbrowser(nDlg.FileName)
- End If
- End Sub
- '========================以上已修改======================================================
- 'Private Sub mnuPopTabs_CloseFrame_Click()
- 'Call UnloadBrowser(popWbbIdx)
- 'End Sub
- Private Sub mnuCloseTab_Click()
- If loadedBrowserCount > 0 Then
- Call UnloadBrowser(gActiveWebIndex)
- End If
- End Sub
- Private Sub mnuExit_Click()
- Unload Me
- End Sub
- 'Private Sub mnuFavorite_Click()
- ''If gActiveWebIndex > 0 Then
- '' mnuAddFavorite.Enabled = True
- ''Else
- '' mnuAddFavorite.Enabled = False
- ''End If
- 'If Not loadSubInfo(0).isLoadSub Then
- ' Call SeedFile(favoritePath, loadSubInfo(0).hwnd, FavoriteMenuPosOffset, False)
- ' loadSubInfo(0).isLoadSub = True
- 'End If
- '
- ''=======================================
- ''Dim rv As Long
- ''Dim hSubMenu As Long
- ''Dim mnuItemCount As Long
- ''Dim mInfo As MENUITEMINFO
- ''Dim pad As Long
- ''Dim t(255) As Byte
- ''
- '''获取菜单项句柄和子菜单项数
- ''hSubMenu = loadSubInfo(0).hwnd ' GetSubMenu(GetMenu(Me.hwnd), 0)
- ''mnuItemCount = GetMenuItemCount(hSubMenu)
- ''
- '''将子菜单项分成两部分
- ''If mnuItemCount Mod 2 <> 0 Then pad = 1
- '''取得当前菜单信息
- ''mInfo.cbSize = Len(mInfo)
- ''mInfo.fMask = MIIM_ID Or MIIM_STATE Or MIIM_TYPE Or MIIM_DATA
- '''mInfo.fType = MFT_OWNERDRAW
- ''mInfo.dwTypeData = VarPtr(t(0)) ' Space$(256)
- ''mInfo.cch = Len(mInfo.dwTypeData)
- ''rv = GetMenuItemInfo(hSubMenu, (mnuItemCount 2) + pad, True, mInfo)
- ''
- '''按新格式显示菜单
- ''mInfo.fType = MF_MENUBARBREAK Or mInfo.fType
- ''
- ''rv = SetMenuItemInfo(hSubMenu, (mnuItemCount 2) + pad, True, mInfo)
- ''=================================================
- '
- 'End Sub
- Private Sub mnuFontSizeList_Click(index As Integer)
- webbState(gActiveWebIndex).webForm.SetFontSize 4 - index
- 'tlbMe.Buttons("fontsize").Value = tbrUnpressed
- End Sub
- Private Sub mnuGb_Click()
- If loadedBrowserCount > 0 Then
- webbState(gActiveWebIndex).webForm.SetCharset "gb2312"
- End If
- 'Me.ActiveForm.webMe.Document.Charset = "gb2312"
- 'Me.ActiveForm.webMe.Refresh2
- End Sub
- Private Sub mnuInternetOption_Click()
- 'Call Shell("rundll32.exe shell32.dll,Control_RunDLL Inetcpl.cpl", vbNormalFocus)
- Call LaunchInternetControlPanel(Me.hWnd)
- End Sub
- Private Sub mnuNewB_Click()
- If loadedBrowserCount > browserCount Then Exit Sub
- Dim index As Integer
- index = NewWebbrowser("about:blank")
- End Sub
- 'Private Sub mnuNewN_Click()
- ''Call MDIForm_KeyDown(vbKeyN, vbCtrlMask)
- 'End Sub
- '设置"代理"
- Private Sub ChangeProxy()
- Call ChangeProxy_ctl
- Call ChangeProxy_real
- End Sub
- '设置"代理"(实际上的设置)
- Private Sub ChangeProxy_real()
- Static tLoading As Long
- Dim proxyMe As INTERNET_PROXY_INFO
- If IsUseProxy = 1 Then
- If ProxySelected > 0 And ProxySelected <= proxyDataCount Then
- With proxyMe
- .dwAccessType = INTERNET_OPEN_TYPE_PROXY
- '.lpszProxy = "http=" & Trim$(tmpData.address) & ":" & Trim$(tmpData.port)
- .lpszProxy = Trim$(proxyData(ProxySelected).address) & ":" & Trim$(proxyData(ProxySelected).port)
- .lpszProxyBypass = "<local>"
- If proxyData(ProxySelected).isByPass = 1 Then
- Dim tmpStr As String
- tmpStr = ";" '& Chr(13) & Chr(10)
- .lpszProxyBypass = "<local> " & Replace(Trim$(proxyData(ProxySelected).bypass), tmpStr, " ")
- .lpszProxyBypass = Replace(.lpszProxyBypass, Chr(13) & Chr(10), "")
- End If
- End With
- Call InternetSetOption(0&, INTERNET_OPTION_PROXY, proxyMe, Len(proxyMe))
- ElseIf ProxySelected = 0 Then
- proxyMe.dwAccessType = INTERNET_OPEN_TYPE_PRECONFIG
- Call InternetSetOption(0&, INTERNET_OPTION_PROXY, proxyMe, Len(proxyMe))
- If tLoading = 2 Then
- MsgBox "请重新启动程序,使设置生效", vbOKOnly + vbInformation
- End If
- End If
- Else
- proxyMe.dwAccessType = INTERNET_OPEN_TYPE_DIRECT
- Call InternetSetOption(0&, INTERNET_OPTION_PROXY, proxyMe, Len(proxyMe))
- End If
- tLoading = 2
- End Sub
- '设置"代理"(一些控件上的设置)
- Private Sub ChangeProxy_ctl()
- Dim i&
- Dim tUseProxy As Boolean
- tUseProxy = (IsUseProxy = 1)
- pMnu_Proxy.CheckItem IDM_Main_Tools_Proxy_Nouse, Not tUseProxy
- 'tlbMe.Buttons(TbrK_Main_Proxy).Value = IsUseProxy
- If Not m_cTbrMain Is Nothing Then
- Call m_cTbrMain.CheckButton(TbrID_Main_Proxy, IsUseProxy = 1)
- End If
- pMnu_Proxy.EnableItem IDM_Main_Tools_Proxy_UseieCfg, tUseProxy
- pMnu_Proxy.CheckItem IDM_Main_Tools_Proxy_UseieCfg, False
- For i = 1 To proxyDataCount
- pMnu_Proxy.EnableItem i + IdOffset_Proxy, tUseProxy
- pMnu_Proxy.CheckItem i + IdOffset_Proxy, False
- Next i
- If tUseProxy Then
- If ProxySelected = 0 Then
- pMnu_Proxy.CheckItem IDM_Main_Tools_Proxy_UseieCfg, True
- ElseIf ProxySelected > 0 And ProxySelected <= proxyDataCount Then
- pMnu_Proxy.CheckItem ProxySelected + IdOffset_Proxy, True
- End If
- End If
- tmrCheckTbr.Enabled = tUseProxy
- End Sub
- Private Sub mnuNoProxy_Click()
- If IsUseProxy = 1 Then
- IsUseProxy = 0
- Else
- IsUseProxy = 1
- End If
- Call ChangeProxy
- 'mnuNoProxy.Checked = Not mnuNoProxy.Checked
- '
- 'If mnuNoProxy.Checked Then
- ' IsUseProxy = 0
- 'Else
- ' IsUseProxy = 1
- 'End If
- '
- 'Dim i As Integer
- 'If Not mnuNoProxy.Checked Then
- ' tlbMe.Buttons("proxy").Value = tbrUnpressed ' tbrPressed
- '
- ' mnuNoProxy.Checked = True
- ' Dim proxyMe As INTERNET_PROXY_INFO
- ' With proxyMe
- ' .dwAccessType = INTERNET_OPEN_TYPE_DIRECT
- ' End With
- '
- ' Call InternetSetOption(0&, INTERNET_OPTION_PROXY, proxyMe, Len(proxyMe))
- '
- ' For i = 1 To mnuProxyList.Count - 1
- ' mnuProxyList(i).Enabled = False
- ' Next
- 'Else
- ' 'tlbMe.Buttons("proxy").Style = tbrDropdown
- ' tlbMe.Buttons("proxy").Value = tbrPressed ' tbrUnpressed
- ' tmrCheckTbr.Enabled = True
- '
- ' mnuNoProxy.Checked = False
- ' For i = 1 To mnuProxyList.Count - 1
- ' mnuProxyList(i).Enabled = True
- ' Next
- ' Call SetProxy(proxyData(ProxySelected))
- 'End If
- End Sub
- Private Sub mnuOption_Click()
- frmOption.Show 0, Me
- End Sub
- Private Sub mnuOrganizeFav_Click()
- 'Dim tmpObj As New ShellUIHelper
- 'tmpobj.
- Dim tmpStr As String
- tmpStr = favoritePath
- Call DoOrganizeFavDlg(Me.hWnd, tmpStr)
- Call RefreshFavorite(0)
- End Sub
- 'Private Sub mnuPopTabs_Mimimized_Click()
- '
- 'If loadedBrowserCount > 1 Then
- ' Dim tIndex As Long
- ' tIndex = gActiveWebIndex
- ' SwitchTabs Val(lstOrder.List(1))
- ' webbState(tIndex).webForm.ZOrder 1
- ' lstOrder.RemoveItem (1)
- ' lstOrder.AddItem tIndex
- 'End If
- '
- '
- 'End Sub
- 'Private Sub mnuPopTabs_SelectTab_Click()
- ''webbState(popWbbIdx).webTab.Selected = Not webbState(popWbbIdx).webTab.Selected
- 'webbState(popWbbIdx).TabBtn.Selected = Not webbState(popWbbIdx).TabBtn.Selected
- ''If webbState(popWbbIdx).webTab.Selected Then
- 'If webbState(popWbbIdx).TabBtn.Selected Then
- ' selectedTabsCount = selectedTabsCount + 1
- '
- ' Else
- ' selectedTabsCount = selectedTabsCount - 1
- 'End If
- 'End Sub
- 'Private Sub mnuProxyList_Click(index As Integer)
- 'ProxySelected = index
- 'Call ChangeProxy
- ''If ProxySelected > 0 Then
- '' mnuProxyIE.Checked = False
- '' mnuProxyList(ProxySelected).Checked = False
- '' 'tlbMe.Buttons("noproxy").ButtonMenus(proxySelected).Enabled = True
- ''End If
- ''mnuProxyList(index).Checked = True
- '''tlbMe.Buttons("noproxy").ButtonMenus(Index).Enabled = False
- ''ProxySelected = index
- ''Call SetProxy
- 'End Sub
- Private Sub mnuProxySetup_Click()
- Dim tFrm As frmProxy
- Set tFrm = New frmProxy
- tFrm.Show vbModal, Me
- 'frmProxy.Show vbModal, Me
- If Not tFrm.IsCancel Then
- Call SaveProxy
- Call ReloadProxyMenu
- Call ChangeProxy
- End If
- Unload tFrm
- End Sub
- '加载代理菜单
- Private Sub ReloadProxyMenu()
- Dim i&
- pMnu_Proxy.RemoveItems 4, pMnu_Proxy.GetItemCount() - 1
- If proxyDataCount > 0 Then
- pMnu_Proxy.Add "", pmsSeparator
- For i = 1 To proxyDataCount
- pMnu_Proxy.Add RTrim$(proxyData(i).proxyName), , i + IdOffset_Proxy
- Next i
- If ProxySelected > proxyDataCount Or ProxySelected < 0 Then
- ProxySelected = 0
- End If
- Else
- ProxySelected = 0
- End If
- 'For i = 1 To mnuProxyList.Count - 1
- ' Unload mnuProxyList(i)
- 'Next
- '
- '
- 'If proxyDataCount > 0 Then
- ' For i = 1 To proxyDataCount
- ' Load mnuProxyList(i)
- ' With mnuProxyList(i)
- ' .Caption = RTrim$(proxyData(i).proxyName)
- ' .Visible = True
- ' End With
- ' Next i
- '
- ' If ProxySelected > proxyDataCount Or ProxySelected < 0 Then
- ' ProxySelected = 0
- ' End If
- 'Else
- ' ProxySelected = 0
- 'End If
- 'Call ChangeProxy
- End Sub
- 'Private Sub mnuRecent_MoreFav_Click(index As Integer)
- 'Call NewWebbrowser(mnuRecent_MoreFav(index).Tag)
- 'Call ClickFavorite(mnuRecent_MoreFav(index).Caption, _
- ' mnuRecent_MoreFav(index).Tag)
- '
- 'End Sub
- Private Sub mnuRefreshFavorite_Click()
- Call RefreshFavorite
- End Sub
- Private Sub mnuSaveAs_Click()
- If loadedBrowserCount > 0 Then
- webbState(gActiveWebIndex).webForm.SaveWeb
- End If
- End Sub
- '地址栏
- Private Sub mnuShowAddressBar_Click()
- If gFullScreenMode Then Exit Sub
- gShowAddressbar = Not gShowAddressbar
- pMnu_ViewToolbar.CheckItem IDM_Main_View_Toolbar_Address, gShowAddressbar
- 'mnuShowAddressBar.Checked = gShowAddressbar
- m_cRebar.ShowBand ID_Band_Address, gShowAddressbar, True
- End Sub
- '主工具栏
- Private Sub mnuShowButtonBar_Click()
- If gFullScreenMode Then Exit Sub
- gShowMainToolbar = Not gShowMainToolbar
- pMnu_ViewToolbar.CheckItem IDM_Main_View_Toolbar_StdButton, gShowMainToolbar
- 'mnuShowButtonBar.Checked = gShowMainToolbar
- m_cRebar.ShowBand ID_Band_MainTbr, gShowMainToolbar, True
- End Sub
- Private Sub mnuShowCustomToolbar_Click()
- Dim tFrm As frmCmsToolbar
- Set tFrm = New frmCmsToolbar
- Load tFrm
- tFrm.IniMe m_cTbrMain, m_cTbrSmall
- tFrm.Show vbModal, Me
- End Sub
- '小工具栏
- Private Sub mnuShowMintoolBar_Click()
- If gFullScreenMode Then Exit Sub
- gShowSmallToolbar = Not gShowSmallToolbar
- pMnu_ViewToolbar.CheckItem IDM_Main_View_Toolbar_MinTbr, gShowSmallToolbar
- 'mnuShowMintoolBar.Checked = gShowSmallToolbar
- m_cRebar.ShowBand ID_Band_SmallTbr, gShowSmallToolbar, True
- End Sub
- Private Sub mnuShowSearchBar_Click()
- If gFullScreenMode Then Exit Sub
- gShowSearchbar = Not gShowSearchbar
- pMnu_ViewToolbar.CheckItem IDM_Main_View_Toolbar_Searchbar, gShowSearchbar
- 'mnuShowSearchBar.Checked = gShowSearchbar
- m_cRebar.ShowBand ID_Band_SearchTbr, gShowSearchbar, True
- End Sub
- '状态栏
- Private Sub mnuShowStatusBar_Click()
- If gFullScreenMode Then Exit Sub
- gShowStatusbar = Not gShowStatusbar
- pMnu_ViewToolbar.CheckItem IDM_Main_View_Toolbar_Status, gShowStatusbar
- 'mnuShowStatusBar.Checked = gShowStatusbar
- pctHoldStatus.Visible = gShowStatusbar
- 'stabMe.Visible = gShowStatusbare
- End Sub
- '标签栏
- Private Sub mnuShowTabBar_Click()
- If gFullScreenMode Then Exit Sub
- gShowTabsbar = Not gShowTabsbar
- pMnu_ViewToolbar.CheckItem IDM_Main_View_Toolbar_Tabs, gShowTabsbar
- 'mnuShowTabBar.Checked = gShowTabsbar
- m_cRebar.ShowBand ID_Band_Tabs, gShowTabsbar, True
- End Sub
- 'Private Sub mnuSysTrayExit_Click()
- 'Unload Me
- 'End Sub
- '
- 'Private Sub mnuSysTrayShow_Click()
- 'Call ShowMe(True)
- 'End Sub
- Private Sub mnuTabs_AddFilter_Click()
- If loadedBrowserCount > 0 Then
- Call webbState(gActiveWebIndex).webForm.AddToUrlFilter
- End If
- End Sub
- 'Private Sub mnuTabs_Click()
- 'If loadedBrowserCount > 0 Then
- ' mnuTabs_NoFloat.Enabled = True
- ' mnuTabs_NoObject.Enabled = True
- ' mnuClearMouseLimit.Enabled = True
- ' mnuTabs_AddFilter.Enabled = True
- '
- ' 'mnuTabs_Hide.Enabled = True
- 'Else
- ' mnuTabs_NoFloat.Enabled = False
- ' mnuTabs_NoObject.Enabled = False
- ' mnuClearMouseLimit.Enabled = False
- ' mnuTabs_AddFilter.Enabled = False
- '
- ' 'mnuTabs_Hide.Enabled = False
- 'End If
- 'End Sub
- 'Private Sub mnuTabs_Hide_HidePage_Click()
- 'If loadedBrowserCount > 0 Then
- ' webbState(gActiveWebIndex).Hided = True
- 'End If
- 'End Sub
- Private Sub mnuTabs_NoFloat_Click()
- If loadedBrowserCount > 0 Then
- webbState(gActiveWebIndex).webForm.NoShowFloat
- End If
- End Sub
- Private Sub mnuTabs_NoObject_Click()
- If loadedBrowserCount > 0 Then
- webbState(gActiveWebIndex).webForm.NoShowObject
- End If
- End Sub
- 'Private Sub mnuTabs_PageZoom_Click()
- 'Dim EnableItem As Boolean
- 'Dim i&
- 'EnableItem = (loadedBrowserCount > 0)
- 'For i = 0 To 4
- ' mnuTabs_PageZoom_Item(i).Enabled = EnableItem
- 'Next i
- 'End Sub
- Private Sub mnuTabs_PageZoom_Item_Click(index As Integer)
- If loadedBrowserCount > 0 Then
- Dim tZoom As Single
- Select Case index
- Case 0: tZoom = 0.6
- Case 1: tZoom = 0.8
- Case 2: tZoom = 1
- Case 3: tZoom = 1.2
- Case 4: tZoom = 1.4
- End Select
- webbState(gActiveWebIndex).webForm.SetPageZoom (tZoom)
- End If
- End Sub
- 'Private Sub mnuTabs_Scripts_Item_Click(index As Integer)
- 'If loadedBrowserCount > 0 Then
- ' If Not gScripts(index).LoadedScript Then
- ' Call LoadScriptFile2(gScripts(index))
- ' End If
- ' webbState(gActiveWebIndex).webForm.RunScript gScripts(index).Script, gScripts(index).Language, gScripts(index).RunType
- '
- '' frmCollectBoard.Show , Me
- '' frmCollectBoard.AddTab gScripts(index).Script
- 'End If
- 'End Sub
- 'Private Sub mnuTabs_Scripts_Reload_Click()
- 'Call ReloadScript
- 'End Sub
- 'Private Sub mnuTabs_Scripts_ViewFolder_Click()
- 'On Error Resume Next
- 'Dim tPop As cShowFilePropertyWindow
- 'Set tPop = New cShowFilePropertyWindow
- 'tPop.ShowProps AppPath & "script", verbShowExplorer
- 'End Sub
- 'Private Sub mnuTools_Click()
- ''If Not (Me.ActiveForm Is Nothing) Then
- '' mnuFiltrate.Enabled = True
- '' mnuFiltrate.Checked = Me.ActiveForm.isFiltrate
- '' Else
- '' mnuFiltrate.Enabled = False
- ''End If
- '
- 'End Sub
- 'Private Sub mnuTurnTo_HightLight_Click()
- 'If loadedBrowserCount > 0 Then
- ' Call webbState(gActiveWebIndex).webForm.HightLight(cmbAdd.Text)
- 'End If
- 'End Sub
- 'Private Sub mnuTurnTo_NewIE_Click()
- 'Call NewIE(cmbAdd.Text)
- 'End Sub
- '
- 'Private Sub mnuTurnTo_NewTab_Click()
- 'Call NewWebbrowser(cmbAdd.Text)
- 'End Sub
- '
- 'Private Sub mnuTurnTo_Search_Click(index As Integer)
- 'Call ReplaceAddress(CLng(index))
- 'End Sub
- '
- 'Private Sub mnuTurnTo_TurnTo_Click()
- 'cmbAdd.AddItem cmbAdd.Text
- 'If loadedBrowserCount > 0 Then
- ' webbState(gActiveWebIndex).webForm.Navigate cmbAdd.Text, False
- 'Else
- ' Call NewWebbrowser(cmbAdd.Text)
- 'End If
- 'End Sub
- 'Private Sub mnuView_Click()
- 'If gActiveWebIndex > 0 Then
- ' mnuViewSource.Enabled = True
- ' mnuEncode.Enabled = True
- ' mnuFontSize.Enabled = True
- 'Else
- ' mnuViewSource.Enabled = False
- ' mnuEncode.Enabled = False
- ' mnuFontSize.Enabled = False
- 'End If
- '
- ''dim i As Integer
- ''For i = 0 To 4
- '' mnuFontSizeList(i).Checked = False
- ''Next
- '
- ''mnuFontSizeList(webbState(gActiveWebIndex).fontSize).Checked = True
- 'End Sub
- Private Sub mnuView_CloseWindowList_Click()
- frmSpPageList.Show , Me
- End Sub
- Private Sub mnuView_FullScreen_Click()
- gFullScreenMode = Not gFullScreenMode
- 'mnuView_FullScreen.Checked = gFullScreenMode
- Call FullScreen(gFullScreenMode)
- End Sub
- '全屏
- Public Sub FullScreen(nIs As Boolean)
- fraTitleButton.Visible = Not nIs
- If nIs Then
- Call SetWindowLong(Me.hWnd, GWL_STYLE, GetWindowLong(Me.hWnd, GWL_STYLE) Or WS_CAPTION Xor WS_CAPTION)
- Call SetWindowPos(Me.hWnd, HWND_TOP, 0, 0, Me.width / 15, Me.height / 15 + 1, SWP_NOACTIVATE + SWP_SHOWWINDOW + SWP_NOMOVE)
- Call SetWindowPos(Me.hWnd, HWND_TOP, 0, 0, Me.width / 15, Me.height / 15 - 1, SWP_NOACTIVATE + SWP_SHOWWINDOW + SWP_NOMOVE)
- pctReBar.Visible = False
- pctHoldStatus.Visible = False
- 'stabMe.Visible = False
- mTempCaption = Me.Caption
- Else
- Call SetWindowLong(Me.hWnd, GWL_STYLE, GetWindowLong(Me.hWnd, GWL_STYLE) Or WS_CAPTION)
- Call SetWindowPos(Me.hWnd, HWND_TOP, 0, 0, Me.width / 15, Me.height / 15 + 1, SWP_NOACTIVATE + SWP_SHOWWINDOW + SWP_NOMOVE)
- Call SetWindowPos(Me.hWnd, HWND_TOP, 0, 0, Me.width / 15, Me.height / 15 - 1, SWP_NOACTIVATE + SWP_SHOWWINDOW + SWP_NOMOVE)
- 'pctReBar.Visible = gShowAddressbar Or gShowMainToolbar Or _
- gShowSmallToolbar Or gShowTabsbar
- pctReBar.Visible = True
- pctHoldStatus.Visible = gShowStatusbar
- 'stabMe.Visible = gShowStatusbar
- Me.Caption = mTempCaption
- mTempCaption = ""
- End If
- End Sub
- Private Sub mnuViewHide_Click()
- Call ShowMe(False)
- End Sub
- Private Sub mnuViewLockToolBar_Click()
- gLockToolBar = Not gLockToolBar
- 'gLockToolBar = Not mnuViewLockToolBar.Checked
- 'mnuViewLockToolBar.Checked = gLockToolBar
- 'mnuLockCoolBar.Checked = gLockToolBar
- pMnu_ViewToolbar.CheckItem IDM_Main_View_Toolbar_Lock, gLockToolBar
- m_cRebar.LockBands gLockToolBar
- End Sub
- Private Sub mnuViewSlide_Click()
- frmSlide.Show , Me
- 'mnuViewSlide.Checked = Not mnuViewSlide.Checked
- 'If mnuViewSlide.Checked Then
- ' frmSlide.Show , Me
- 'Else
- ' frmSlide.Hide
- 'End If
- End Sub
- Private Sub mnuViewSource_Click()
- webbState(gActiveWebIndex).webForm.webMe.Navigate2 "view-source:" & webbState(gActiveWebIndex).webForm.webMe.LocationURL ', , "_blank"
- End Sub
- Private Sub mnuWindowArrange_Click(index As Integer)
- Me.Arrange index
- End Sub
- Private Sub mySysTray_MouseDown(Button As Integer, id As Long)
- If Button = vbLeftButton Then
- Call ShowMe(True)
- ' Me.Show
- ' Me.WindowState = mWindowState
- ' fraTitleButton.Visible = Not mnuView_FullScreen.Checked
- ' mySysTray.InTray = False
- End If
- End Sub
- Private Sub mySysTray_MouseUp(Button As Integer, id As Long)
- If Button = vbRightButton Then
- 'Me.PopupMenu mnuSysTray, , , , mnuSysTrayShow
- Dim tId&
- tId = mPopmnuSystray.Popup()
- Select Case tId
- Case 101
- Call ShowMe(True)
- Case 102
- Call Unload(Me)
- End Select
- End If
- End Sub
- Private Sub pctAddress_Resize()
- If Me.WindowState = 1 Then Exit Sub
- Dim tWidth As Single
- 'tWidth = pctAddress.width - tbrAddress.width
- tWidth = pctAddress.width - mTrnToBtnWidth * 15 - 15 ' cbnTurnto.pWidth - 15
- If tWidth < 0 Then tWidth = 0
- cmbAdd.width = tWidth
- 'tbrAddress.Left = cmbAdd.width + 15
- 'cbnTurnto.pLeft = cmbAdd.width + 15
- pctTurnBtn.Top = 0
- pctTurnBtn.Left = cmbAdd.width + 15
- End Sub
- Private Sub pctHoldFavorite_Resize()
- On Error Resume Next
- 'Dim tRight
- If Not m_cTbrSidebar Is Nothing Then
- 'm_cTbrSidebar.GetBtnRect 102, , , tRight
- m_cTbrSidebar.MoveToolbar _
- pctHoldFavorite.width / 15 - m_cTbrSidebar.GetToolbarWidth, _
- 0, 0, 0, False, True
- End If
- pctSideBandHold.Move 0, m_cTbrSidebar.GetToolbarHeight, _
- pctHoldFavorite.ScaleWidth, _
- pctHoldFavorite.ScaleHeight - m_cTbrSidebar.GetToolbarHeight
- Dim i&
- For i = 1 To gPluginSBCnt
- SetSidebandSize gPluginsSideBand(i)
- Next i
- End Sub
- Private Sub pctSideBandHold_Resize()
- If Not m_cTvwFav Is Nothing Then
- m_cTvwFav.Move 0, 0, _
- pctSideBandHold.ScaleWidth, _
- pctSideBandHold.ScaleHeight
- End If
- End Sub
- Private Sub pctSideBar_Resize()
- If Me.WindowState = 1 Or FloatFavorite = 0 Then Exit Sub
- Call resizeFramFravorite
- 'Dim i&
- 'For i = 1 To gPluginSBCnt
- ' gPluginsSideBand(i).Resize pctSideBar.Width / 15 - 10, pctSideBar.Height / 15
- 'Next i
- End Sub
- Private Sub pctHoldStatus_Resize()
- If Not m_cSsbar Is Nothing Then
- m_cSsbar.Move 0, 0, 0, 0
- Call SetStatusParts
- End If
- End Sub
- Private Sub pctReBar_Resize()
- m_cRebar.SetBarWidth pctReBar.ScaleWidth
- End Sub
- 'Private Sub pctSearch_Resize()
- 'On Error Resume Next
- '
- '
- ''cmbSearch.Move 0, 15, pctSearch.Width - tbrSearch.Width ', pctSearch.Height
- ''cmbSearch.Move 0, 15, pctSearch.Width - mcTbrSearch.GetToolbarWidth * 15
- ''tbrSearch.Move cmbSearch.Width, 0 ', , pctSearch.Height
- 'mcTbrSearch.MoveToolbar cmbSearch.Width / 15, 0, 0, 0, False, True
- '
- ''Call HackCombobox(cmbSearch.hwnd, pctSearchIcon.hwnd)
- '
- 'End Sub
- 'Private Sub pctSearchIcon_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
- 'Call PopSearchMenu
- 'End Sub
- '弹出搜索引擎(单引擎)菜单
- Private Sub PopSearchMenu(Optional UsePos As Boolean = False, _
- Optional x&, Optional y&)
- Dim tRc As RECT
- Dim tId As Long
- If UsePos Then
- tRc.Left = x: tRc.Bottom = y
- Else
- GetWindowRect cmbSearch.hWnd, tRc
- End If
- Call pMnu_Searchbar.CheckRadioItem(gDefaultEgn - 1, False)
- Call pMnu_Searchbar.SetDefault(gDefaultEgn, True)
- tId = pMnu_Searchbar.Popup2(Me.hWnd, False, tRc.Left, tRc.Bottom)
- If tId > 0 And tId <= gSearchEgnCount Then
- gDefaultEgn = tId
- mcTbrSearch.SetButtonCaption TbrID_Search_Search, gSearchEgn(tId).Title
- Call ResizeTbrSearch
- Call OpenSearchPage(tId)
- pMnu_Searchbar.SetDefault tId, True
- End If
- End Sub
- '弹出搜索引擎(多引擎)菜单
- Private Sub PopMulSearchMenu(Optional UsePos As Boolean = False, _
- Optional x&, Optional y&)
- Dim tRc As RECT
- Dim tId As Long
- If UsePos Then
- tRc.Left = x: tRc.Bottom = y
- Else
- GetWindowRect cmbSearch.hWnd, tRc
- End If
- Call pMnu_MulSearch.CheckRadioItem(gDefaultMulEgn - 1, False)
- Call pMnu_MulSearch.SetDefault(gDefaultMulEgn)
- tId = pMnu_MulSearch.Popup2(Me.hWnd, False, tRc.Left, tRc.Bottom)
- If tId > 0 And tId <= gMulSearchCount Then
- gDefaultMulEgn = tId
- mcTbrSearch.SetButtonCaption TbrID_Search_MulSearch, gMulSearch(tId).Title
- Call ResizeTbrSearch
- Call OpenMulSearchPage(tId)
- End If
- End Sub
- Private Sub pctTabs_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
- If Button = vbRightButton Then
- Call popMenuLockToolBar
- End If
- End Sub
- Private Sub pctTabs_Resize()
- If Me.WindowState = 1 Then Exit Sub
- With fraHoldOpt
- '.width = pctTabs.width
- .Top = 0
- '.left = 0
- End With
- Call refreshTab
- End Sub
- Private Sub TabBar_DblClick(x As Long, y As Long)
- Dim tBtn As cButton
- Set tBtn = TabBar.Hittest(x, y)
- If Not tBtn Is Nothing Then
- Call UnloadBrowser(gActiveWebIndex)
- 'TabBar.RemoveByIndex tBtn.Index
- End If
- End Sub
- Private Sub TabBar_DragDrop(x As Long, y As Long)
- Dim tBtn As cButton
- Set tBtn = TabBar.Hittest(x, y)
- If Not tBtn Is Nothing Then
- TabBar.MoveButton downButton.index, tBtn.index
- End If
- End Sub
- Private Sub TabBar_MouseDown(Button As Integer, Shift As Integer, x As Long, y As Long, btn As cButton)
- Set downButton = btn
- downX = x: downY = y
- If Not btn Is Nothing Then
- mMouseDownTabIndex = btn.TagL
- If Button = vbLeftButton And Shift = vbShiftMask Then
- btn.Selected = Not btn.Selected
- If btn.Selected Then
- selectedTabsCount = selectedTabsCount + 1
- Else
- selectedTabsCount = selectedTabsCount - 1
- End If
- End If
- End If
- End Sub
- Private Sub TabBar_MouseMove(Button As Integer, Shift As Integer, x As Long, y As Long, btn As cButton)
- If Button = vbRightButton Then
- If Not downButton Is Nothing Then
- If btn Is downButton Then
- If Abs(x - downX) > 5 Or Abs(y - downY) > 5 Then
- TabBar.DragBegin
- End If
- End If
- End If
- ElseIf Button = vbLeftButton Then
- If Not downButton Is Nothing Then
- If Not btn Is Nothing Then
- If Abs(x - downX) > 5 Then
- selectedTabsCount = TabBar.SelectButton(btn.index, downButton.index)
- End If
- End If
- End If
- End If
- End Sub
- Private Sub TabBar_MouseUp(Button As Integer, Shift As Integer, x As Long, y As Long, btn As cButton)
- Dim tBtn As cButton, tbtns As Collection
- If Not btn Is Nothing Then
- If downButton Is btn Then
- If Button = vbLeftButton And Shift = 0 Then
- Debug.Print "button check", btn.index, btn.TagL
- If Not btn.Checked Then
- 'TabBar.CheckRadioButton btn.index
- Call SwitchTabs(CLng(btn.TagL))
- Set tbtns = TabBar.Buttons
- For Each tBtn In tbtns
- tBtn.Selected = False
- Next tBtn
- selectedTabsCount = 0
- End If
- ElseIf Button = vbRightButton Then
- btn.ButtonState = cbtnNormal
- ' ===== old ========
- 'popWbbIdx = btn.TagL
- ' If popWbbIdx <> gActiveWebIndex Then
- ' mnuPopTabs_Mimimized.Enabled = False
- ' Else
- ' mnuPopTabs_Mimimized.Enabled = True
- ' End If
- 'Me.PopupMenu mnuPopTabs
- If btn.TagL <> gActiveWebIndex Then
- mPopmnuTabpop.EnableItem mIDM_Tabs_SetBottom, False
- Else
- mPopmnuTabpop.EnableItem mIDM_Tabs_SetBottom, True
- End If
- Call DoTabPopmnu(mPopmnuTabpop.Popup(), btn.TagL)
- ' =========================
- End If
- End If
- End If
- mMouseDownTabIndex = -1
- End Sub
- '处理标签上的右键菜单
- Private Sub DoTabPopmnu(ByVal id&, ByVal index&)
- Select Case id
- Case mIDM_Tabs_AddFavor
- Case mIDM_Tabs_AddUrlFilter
- Call webbState(index).webForm.AddToUrlFilter
- Case mIDM_Tabs_Close
- Call UnloadBrowser(index)
- Case mIDM_Tabs_CloseLeftPages
- Call UnloadBrowsers(1, webbState(index).TabBtn.index - 1)
- Case mIDM_Tabs_CloseRightPages
- Call UnloadBrowsers(webbState(index).TabBtn.index + 1, loadedBrowserCount)
- Case mIDM_Tabs_CloseLike
- Call CloseLikeTabs(index)
- Case mIDM_Tabs_Selected
- webbState(index).TabBtn.Selected = Not webbState(index).TabBtn.Selected
- If webbState(index).TabBtn.Selected Then
- selectedTabsCount = selectedTabsCount + 1
- Else
- selectedTabsCount = selectedTabsCount - 1
- End If
- Case mIDM_Tabs_SetBottom
- If loadedBrowserCount > 1 Then
- Dim tIndex As Long
- tIndex = gActiveWebIndex
- 'SwitchTabs Val(lstOrder.List(1))
- webbState(tIndex).webForm.ZOrder 1
- ' lstOrder.RemoveItem (1)
- ' lstOrder.AddItem tIndex
- End If
- End Select
- End Sub
- Private Sub TabGoLeftBar_MouseDown(Button As Integer, Shift As Integer, x As Long, y As Long, btn As cButton)
- If Button = vbLeftButton Then
- tabsPos = tabsPos - 1
- Call refreshTab
- tabMoveDir = -1
- timerMoveTab.Enabled = True
- ElseIf Button = vbRightButton Then
- OtherPagePopMenu.Popup2 Me.hWnd
- 'myButtonGoLeft.Refresh
- btn.ButtonState = cbtnNormal
- End If
- End Sub
- Private Sub TabGoLeftBar_MouseUp(Button As Integer, Shift As Integer, x As Long, y As Long, btn As cButton)
- If Button = vbLeftButton Then
- tabMoveDir = 0
- timerMoveTab.Enabled = False
- End If
- End Sub
- Private Sub TabGoRightBar_MouseDown(Button As Integer, Shift As Integer, x As Long, y As Long, btn As cButton)
- If Button = vbLeftButton Then
- tabsPos = tabsPos + 1
- Call refreshTab
- tabMoveDir = 1
- timerMoveTab.Enabled = True
- ElseIf Button = vbRightButton Then
- OtherPagePopMenu.Popup2 Me.hWnd
- 'myButtonGoRight.Refresh
- btn.ButtonState = cbtnNormal
- End If
- End Sub
- Private Sub TabGoRightBar_MouseUp(Button As Integer, Shift As Integer, x As Long, y As Long, btn As cButton)
- If Button = vbLeftButton Then
- tabMoveDir = 0
- timerMoveTab.Enabled = False
- End If
- End Sub
- 'Private Sub tbrSearch_ButtonClick(ByVal Button As MSComctlLib.Button)
- 'Dim i&
- 'Select Case Button.Key
- ' Case TbrK_Search_HeightLight
- ' If loadedBrowserCount > 0 Then
- ' webbState(gActiveWebIndex).webForm.HightLight (cmbSearch.Text)
- ' End If
- ' Case TbrK_Search_Find
- ' If loadedBrowserCount > 0 Then
- ' webbState(gActiveWebIndex).webForm.FindWord (cmbSearch.Text)
- ' End If
- ' Case TbrK_Search_Search
- ' For i = 1 To gSearchEgnCount
- ' If gSearchEgn(i).MulSearch Then
- ' Call OpenSearchPage(i)
- ' End If
- ' Next i
- 'End Select
- 'End Sub
- '
- 'Private Sub tbrSearch_ButtonDropDown(ByVal Button As MSComctlLib.Button)
- 'Dim tID&, i&
- 'Dim tPt As POINTAPI
- 'Select Case Button.Key
- ' Case TbrK_Search_Search
- ' Call pMnu_Searchbar.UnCheckAll
- ' For i = 1 To gSearchEgnCount
- ' Call pMnu_Searchbar.CheckItem(i, gSearchEgn(i).MulSearch, True)
- ' Next i
- '
- ' tPt = GetTbrDropDownPoint(mTbrSearchHwnd, Button.index - 1)
- ' tID = pMnu_Searchbar.Popup(Me.hwnd, False, tPt.x, tPt.y)
- ' While tID > 0
- ' gSearchEgn(tID).MulSearch = Not gSearchEgn(tID).MulSearch
- ' pMnu_Searchbar.CheckItem tID, gSearchEgn(tID).MulSearch, True
- ' tID = pMnu_Searchbar.Popup(Me.hwnd, False, tPt.x, tPt.y)
- ' Wend
- 'End Select
- 'End Sub
- Private Sub timerMoveTab_Timer()
- tabsPos = tabsPos + tabMoveDir
- Call refreshTab
- End Sub
- 'Private Sub tlbFavorite_ButtonClick(ByVal Button As MSComctlLib.Button)
- 'Select Case Button.Key
- ' Case "close"
- ' Me.ShowFavorite = tbrUnpressed
- '' tlbMe.Buttons("favorites").Value = tbrUnpressed
- '' pctHoldFavorite.Visible = False
- '' 'Call rfsCtrlSta
- ' Case "lock"
- ' If Button.Value = tbrUnpressed Then
- ' frmFloatFavorite.Show , Me
- ' pctSideBar.Visible = False
- ' 'fraMove.Visible = False
- ' SetParent pctHoldFavorite.hwnd, frmFloatFavorite.hwnd
- ' frmFloatFavorite.resizeFramFravorite Me
- ' Else
- ' frmFloatFavorite.Hide
- ' pctSideBar.Visible = True
- ' 'fraMove.Visible = True
- ' SetParent pctHoldFavorite.hwnd, pctSideBar.hwnd
- ' Call resizeFramFravorite
- ' End If
- ' FloatFavorite = Button.Value
- 'End Select
- 'End Sub
- 'Private Sub tlbMe_ButtonClick(ByVal Button As MSComctlLib.Button)
- 'On Error Resume Next
- 'Dim tFrm As frmBrowser
- 'If loadedBrowserCount > 0 Then
- ' Set tFrm = webbState(gActiveWebIndex).webForm
- 'End If
- '
- 'Select Case Button.Key
- ' Case TbrK_Main_New
- ' Call mnuNewB_Click
- ' Case TbrK_Main_Back
- ' tFrm.webMe.goback
- ' Case TbrK_Main_Forward
- ' tFrm.webMe.goforward
- ' Case TbrK_Main_Stop
- ' tFrm.webMe.Stop
- ' Case TbrK_Main_Refresh
- ' tFrm.RefreshWeb
- ' Case TbrK_Main_Proxy
- ' 'mnuNoProxy.Checked = Not mnuNoProxy.Checked
- ' Call mnuNoProxy_Click
- ' Case TbrK_Main_AutoPreventPop
- ' If loadedBrowserCount > 0 Then
- ' If Button.Value = tbrPressed Then
- ' Button.Value = tbrUnpressed
- ' tFrm.mPvnPop = 0
- ' Else
- ' Button.Value = tbrPressed
- ' tFrm.mPvnPop = 2
- ' End If
- ' End If
- ' Case TbrK_Main_Favorites
- ' If Button.Value = tbrPressed Then
- ' Button.Value = tbrUnpressed
- ' Else
- ' Button.Value = tbrPressed
- ' End If
- ' Me.ShowFavorite = Button.Value
- ' Case TbrK_Main_FontSize
- ' Button.Value = tbrPressed
- ' Call ShowFontSizeMenu
- ' 'Me.PopupMenu mnuFontSize
- ' Button.Value = tbrUnpressed
- ' Case TbrK_Main_RecentClose
- ' If ClosedPages.Count > 0 Then
- ' Call NewWebbrowser(ClosedPages.GetLastUrl)
- ' End If
- '' If re_closepage_count > 0 Then
- '' Call NewWebbrowser(Button.ButtonMenus(1).Tag)
- '' End If
- ' Case TbrK_Main_BlockElement
- ' If loadedBrowserCount > 0 Then
- ' Button.Value = tbrPressed
- ' Call ShowBlockElementMenu
- ' Button.Value = tbrUnpressed
- ' End If
- ' Case TbrK_Main_Option
- ' frmOption.Show 0, Me
- ' Case TbrK_Main_FullScreen
- ' gFullScreenMode = True ' Not gFullScreenMode
- ' 'mnuView_FullScreen.Checked = gFullScreenMode
- ' Call FullScreen(gFullScreenMode)
- '
- 'End Select
- '
- 'End Sub
- 'Private Sub tlbMe_ButtonDropDown(ByVal Button As MSComctlLib.Button)
- 'Select Case Button.Key
- ' Case TbrK_Main_Proxy
- ' 'proxyPop = True
- '
- ' Dim tPt As POINTAPI
- ' tPt = GetTbrDropDownPoint(mHwndTbrMain, Button.index - 1)
- ' pMnu_Proxy.SetDefault IDM_Main_Tools_Proxy_Nouse
- ' pMnu_Proxy.Popup2 Me.hwnd, False, tPt.x, tPt.y, TPM_LEFTALIGN
- ' pMnu_Proxy.SetDefault -1, False
- '' ScreenToClient Me.hwnd, tpt
- '' Me.PopupMenu mnuProxy, , tpt.X * 15, tpt.Y * 15, mnuNoProxy
- ' Case TbrK_Main_Favorites
- ' tPt = GetTbrDropDownPoint(mHwndTbrMain, Button.index - 1)
- ' pMnu_MoreFavorite.Popup2 Me.hwnd, False, tPt.x, tPt.y, TPM_LEFTALIGN
- ' 'ScreenToClient Me.hwnd, tpt
- ' 'Me.PopupMenu mnuRecent_MoreFavs, , tpt.X * 15, tpt.Y * 15
- ' Case TbrK_Main_AutoPreventPop
- ' 'pvnpopPop = True
- '
- ' If loadedBrowserCount > 0 Then
- ' Dim tId&
- ' tPt = GetTbrDropDownPoint(mHwndTbrMain, Button.index - 1)
- '' mPopmnuAutoBlockPopwin.CheckItem 101, False
- '' mPopmnuAutoBlockPopwin.CheckItem 102, False
- '' mPopmnuAutoBlockPopwin.CheckItem 103, False
- '
- ' If webbState(gActiveWebIndex).webForm.mPvnPop > 0 Then
- ' 'mPopmnuAutoBlockPopwin.CheckItem webbState(gActiveWebIndex).webForm.mPvnPop + 100, True
- ' mPopmnuAutoBlockPopwin.CheckRadioItem webbState(gActiveWebIndex).webForm.mPvnPop - 1, False
- ' Else
- ' mPopmnuAutoBlockPopwin.UnCheckAll
- ' End If
- ' tId = mPopmnuAutoBlockPopwin.Popup2(Me.hwnd, False, tPt.x, tPt.y)
- ' If tId > 0 Then
- ' webbState(gActiveWebIndex).webForm.mPvnPop = tId - 100
- ' Button.Value = tbrPressed
- ' End If
- ' End If
- '
- ' Case TbrK_Main_New
- ' If loadedBrowserCount > 0 Then
- ' Button.ButtonMenus("newpresentpage").Enabled = True
- ' Button.ButtonMenus("newIEpresent").Enabled = True
- ' Else
- ' Button.ButtonMenus("newpresentpage").Enabled = False
- ' Button.ButtonMenus("newIEpresent").Enabled = False
- ' End If
- ' Case TbrK_Main_BlockElement
- ' If loadedBrowserCount > 0 Then
- ' Call ShowBlockElementMenu
- ' End If
- '
- ' Case TbrK_Main_Back
- ' If loadedBrowserCount > 0 Then
- ' Call webbState(gActiveWebIndex).webForm. _
- ' SetHistoryButton(TLEF_RELATIVE_BACK, Button)
- ' End If
- ' Case TbrK_Main_Forward
- ' If loadedBrowserCount > 0 Then
- ' Call webbState(gActiveWebIndex).webForm. _
- ' SetHistoryButton(TLEF_RELATIVE_FORE, Button)
- ' End If
- ' Case TbrK_Main_Option
- ' Call ShowOptionButtonMenu(Button.index)
- '' tpt = GetTbrDropDownPoint(mHwndTbrMain, Button.index - 1)
- '' Call pMnu_Option_Main.Popup(Me.hwnd, False, tpt.x, tpt.y)
- ' Case TbrK_Main_RecentClose
- ' Call ShowReopenButtonMenu(Button.index)
- 'End Select
- 'End Sub
- 'Private Sub tlbMe_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
- 'Select Case ButtonMenu.Parent.Key
- '' Case "proxy"
- '' Call mnuProxyList_Click(ButtonMenu.index)
- ' Case TbrK_Main_New
- ' Select Case ButtonMenu.Key
- ' Case "newblankpage"
- ' Call mnuNewB_Click
- ' Case "newpresentpage"
- ' If loadedBrowserCount > 0 Then
- ' Call NewWebbrowser(webbState(gActiveWebIndex).webForm.GetWebUrl)
- ' End If
- ' Case "newclipboard"
- ' Call OpenClipboardUrl
- ' Case "newIEblank"
- ' Call NewIE
- ' Case "newIEpresent"
- ' If loadedBrowserCount > 0 Then
- ' Call NewIE(webbState(gActiveWebIndex).webForm.GetWebUrl)
- ' End If
- ' End Select
- '
- '' Case "fontsize"
- '' Me.PopupMenu mnuFontSize
- '' webbState(gActiveWebIndex).webForm.webMe.ExecWB OLECMDID_ZOOM, OLECMDEXECOPT_DODEFAULT, CLng(ButtonMenu.index - 1)
- ' Case TbrK_Main_AutoPreventPop
- ' If loadedBrowserCount > 0 Then
- ' webbState(gActiveWebIndex).webForm.mPvnPop = ButtonMenu.index
- ' ButtonMenu.Parent.Value = tbrPressed
- ' End If
- '' Case TbrK_Main_RecentClose
- '' Call NewWebbrowser(ButtonMenu.Tag)
- '
- ' Case TbrK_Main_Back
- ' If loadedBrowserCount > 0 Then
- ' webbState(gActiveWebIndex).webForm.WebGo (-ButtonMenu.index)
- ' End If
- ' Case TbrK_Main_Forward
- ' If loadedBrowserCount > 0 Then
- ' webbState(gActiveWebIndex).webForm.WebGo (ButtonMenu.index)
- ' End If
- 'End Select
- 'End Sub
- 'Private Sub tlbMe_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
- 'If Button = vbRightButton Then
- ' Call popMenuLockToolBar
- 'End If
- 'End Sub
- 'Private Sub tlbOther_ButtonClick(ByVal Button As MSComctlLib.Button)
- 'On Error Resume Next
- 'Dim i As Long
- 'Dim tHwnd&
- 'Select Case Button.Key
- ' Case TbrK_Small_NextTab
- ' Call NextLastTab(True)
- '
- ' Case TbrK_Small_LastTab
- ' Call NextLastTab(False)
- '
- ' Case TbrK_Small_Close
- ' Call ClosePage
- ' Case TbrK_Small_LockPresent
- ' isLockPresentWeb = Button.Value
- '
- ' Case TbrK_Small_LockNew
- ' If loadedBrowserCount > 0 Then
- ' If Button.Value = tbrPressed Then
- ' webbState(gActiveWebIndex).webForm.IsAllOpenNew = 1
- ' Else
- ' webbState(gActiveWebIndex).webForm.IsAllOpenNew = 0
- ' End If
- ' End If
- ' Case TbrK_Small_Max
- ' If loadedBrowserCount > 0 Then
- ' Select Case webbState(gActiveWebIndex).webForm.WindowState
- ' Case vbNormal
- ' ShowWindow webbState(gActiveWebIndex).webForm.hwnd, SW_MAXIMIZE
- ' Case Else 'vbMaximized, vbMinimized
- ' ShowWindow webbState(gActiveWebIndex).webForm.hwnd, SW_RESTORE
- ' End Select
- ' End If
- ' Case TbrK_Small_Min
- ' If loadedBrowserCount > 0 Then
- ' If webbState(gActiveWebIndex).webForm.WindowState = vbMinimized Then
- ' ShowWindow webbState(gActiveWebIndex).webForm.hwnd, SW_RESTORE
- ' Else
- ' ShowWindow webbState(gActiveWebIndex).webForm.hwnd, SW_MINIMIZE
- ' End If
- ' End If
- 'End Select
- '
- 'End Sub
- 'Private Sub tlbOther_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
- 'Dim i&
- '
- 'Select Case ButtonMenu.Key
- ' Case "close"
- ' Call ClosePage
- '' If loadedBrowserCount > 0 Then
- '' If selectedTabsCount <= 0 Then
- '' Call UnloadBrowser(gActiveWebIndex)
- '' ElseIf selectedTabsCount > 0 Then
- '' Call CloseMulTab
- '' End If
- '' End If
- ' Case "closeother"
- ' If loadedBrowserCount > 1 Then
- ' If selectedTabsCount <= 0 Then
- ' 'Call UnloadBrowsers(1, webbState(gActiveWebIndex).tabOrder - 1)
- ' Call UnloadBrowsers(1, webbState(gActiveWebIndex).TabBtn.index - 1)
- ' Call UnloadBrowsers(2, loadedBrowserCount)
- ' Else
- ' Call CloseMulTab(True)
- ' End If
- ' End If
- '
- ' Case "closelike"
- ' If loadedBrowserCount > 0 Then
- ' Call CloseLikeTabs(gActiveWebIndex)
- ' End If
- ' Case "closeall"
- ' Call CloseAllTabs
- ' Case "maxall"
- ' NOExeActive = True
- ' SendMessageLng hMDIClient, WM_SETREDRAW, 0&, ByVal 0&
- ' For i = lstOrder.ListCount - 1 To 0 Step -1
- ' BringWindowToTop webbState(lstOrder.List(i)).webForm.hwnd
- '
- ' ShowWindow webbState(lstOrder.List(i)).webForm.hwnd, SW_MAXIMIZE
- ' Next i
- ' SendMessageLng hMDIClient, WM_SETREDRAW, 1&, ByVal 0&
- ' RedrawWindow hMDIClient, ByVal 0&, 0&, _
- ' RDW_ALLCHILDREN Or RDW_UPDATENOW Or RDW_INVALIDATE Or RDW_FRAME
- ' NOExeActive = False
- '
- ' Case "restoreall"
- ' NOExeActive = True
- ' SendMessageLng hMDIClient, WM_SETREDRAW, 0&, ByVal 0&
- ' For i = lstOrder.ListCount - 1 To 0 Step -1
- ' BringWindowToTop webbState(lstOrder.List(i)).webForm.hwnd
- ' ShowWindow webbState(lstOrder.List(i)).webForm.hwnd, SW_RESTORE
- '
- ' Next i
- ' SendMessageLng hMDIClient, WM_SETREDRAW, 1&, ByVal 0&
- ' RedrawWindow hMDIClient, ByVal 0&, 0&, _
- ' RDW_ALLCHILDREN Or RDW_UPDATENOW Or RDW_INVALIDATE Or RDW_FRAME
- '
- ' NOExeActive = False
- 'End Select
- 'End Sub
- 'Private Sub tlbOther_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
- 'If Button = vbRightButton Then
- ' Call popMenuLockToolBar
- 'End If
- 'End Sub
- Private Sub tmrAutoSave_Timer()
- Static TimeCount As Long
- TimeCount = TimeCount + 1
- If TimeCount > 600 Then
- Call SaveSettingsToIni
- TimeCount = 0
- End If
- End Sub
- Private Sub tmrCheckTbr_Timer()
- 'tlbMe.Buttons(TbrK_Main_Proxy).Value = tbrPressed
- If Not m_cTbrMain Is Nothing Then
- m_cTbrMain.CheckButton TbrID_Main_Proxy, True
- End If
- tmrCheckTbr.Enabled = False
- End Sub
- '
- 'Private Sub tvwFavorite_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
- 'If Button = vbLeftButton Then
- ' Dim tmpNode As Node
- ' Set tmpNode = tvwFavorite.HitTest(x, y)
- ' If Not (tmpNode Is Nothing) Then
- ' If tmpNode.Tag = "Root" Then
- ' If Not loadSubInfo(tmpNode.index).isLoadSub Then
- ' Call seedFile(tmpNode.Key, loadSubInfo(tmpNode.index).hwnd)
- ' loadSubInfo(tmpNode.index).isLoadSub = True
- ' tmpNode.Expanded = True
- ' Else
- ' tmpNode.Expanded = Not tmpNode.Expanded
- ' End If
- ' Else
- ' If Not tlbOther.Buttons("locknew").Value Then webbState(gActiveWebIndex).isFirst = 1
- ' If Shift = vbShiftMask Then
- ' 'isTabClick = True
- ' Call NewWebbrowser(tmpNode.Tag) 'gActiveWebIndex = newWebbrowser(tmpNode.Tag)
- ' Else
- ' If loadedBrowserCount > 0 Then
- ' Me.ActiveForm.webMe.Navigate tmpNode.Tag
- ' Else
- ' Call NewWebbrowser(tmpNode.Tag)
- ' End If
- ' End If
- ' End If
- ' End If
- ' ElseIf Button = vbRightButton Then
- ' Button = 0
- 'End If
- 'End Sub
- '
- 'Private Sub tvwFavorite_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
- 'Dim tmpNode As Node
- 'Set tmpNode = tvwFavorite.HitTest(x, y)
- 'If Not (tmpNode Is Nothing) Then