📄 connect.dsr
字号:
VERSION 5.00
Begin {AC0714F6-3D04-11D1-AE7D-00A0C90F26F4} Connect
ClientHeight = 13875
ClientLeft = 1740
ClientTop = 1545
ClientWidth = 13680
_ExtentX = 24130
_ExtentY = 24474
_Version = 393216
Description = $"Connect.dsx":0000
DisplayName = "VB 6 增强资源管理器"
AppName = "Visual Basic"
AppVer = "Visual Basic 6.0"
LoadName = "Startup"
LoadBehavior = 1
RegLocation = "HKEY_CURRENT_USER\Software\Microsoft\Visual Basic\6.0"
CmdLineSupport = -1 'True
End
Attribute VB_Name = "Connect"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
Private Const Vb_lBracket = "("
Private Const Vb_rBrackett = ")"
Private Const Vb_Bksl = "\"
Private Const Vb_Sep = "|"
Private Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Declare Function LockWindowUpdate Lib "user32" (ByVal hWndLock As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private hModule As Long
Private bHostShutdown As Boolean
'find the combos in the CodePane window
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
'Global reference to the running instance of VB
Public VBInstance As VBE
'Events handlers
Public nEvents2 As Events2 'Get IDE status
Private WithEvents eVBBuildEvents As VBBuildEvents 'Get IDE status
Attribute eVBBuildEvents.VB_VarHelpID = -1
Public WithEvents mobjFCEvts As FileControlEvents
Attribute mobjFCEvts.VB_VarHelpID = -1
Public WithEvents eVBProjectEvents As VBProjectsEvents
Attribute eVBProjectEvents.VB_VarHelpID = -1
Public WithEvents eVBComponentsEvents As VBComponentsEvents
Attribute eVBComponentsEvents.VB_VarHelpID = -1
Public WithEvents eVBControlsEvents As VBControlsEvents
Attribute eVBControlsEvents.VB_VarHelpID = -1
'Module-level extensibility objects
Public mWindow As Window
Public mobjDoc As docCodeBrowser
'Dockable add-in needs a GUID
Private DockingAddInGUID As String
Private objAddInInst As Object
Private Const Vb_vbp = ".vbp"
Private Const Vb_x = "x"
Sub UnloadAddin()
On Error GoTo eH
Dim oPrjExplorerWindow As Window
100 UnhookMainWindow
' show again the ExplorerWindow
102 For Each oPrjExplorerWindow In VBInstance.Windows
104 If oPrjExplorerWindow.Type = vbext_wt_ProjectWindow Then
106 oPrjExplorerWindow.Visible = True
Exit For
End If
108 Next oPrjExplorerWindow
'Destroy the add-in window
110 Set mobjDoc = Nothing
112 Set mWindow = Nothing
'Destroy the event handlers
114 Set eVBControlsEvents = Nothing
116 Set eVBProjectEvents = Nothing
118 Set eVBComponentsEvents = Nothing
120 Set mobjFCEvts = Nothing
122 Set eVBBuildEvents = Nothing
124 Set nEvents2 = Nothing
'Destroy the VbIDE interface for the add-in window
126 Set modSubclass.VBInstance = Nothing
128 Set modSubclass.Connect = Nothing
Exit Sub
eH:
130 MsgBox Err.Description & vbCrLf & _
"程序 CodeBrowser.Connect.UnloadAddin " & _
"错误行 " & Erl, vbCritical, "错误信息"
132 Resume Next
End Sub
Private Sub AddinInstance_OnBeginShutdown(custom() As Variant)
'if the user closes the ide or sends Alt F4, what is the same thing
On Error GoTo eH
100 bClosingSession = True
102 UnloadAddin
Exit Sub
eH:
104 MsgBox Err.Description & vbCrLf & _
"程序 CodeBrowser.Connect.AddinInstance_OnBeginShutdown " & _
"错误行 " & Erl, vbCritical, "错误信息"
106 Resume Next
End Sub
Private Sub AddinInstance_OnStartupComplete(custom() As Variant)
On Error GoTo eH
DoEvents
If VBInstance.VBProjects.Count Then
mobjDoc.FS_ClickSelected VBInstance.ActiveVBProject.Name & Vb_Sep
End If
StopRedraw IDEhwnd, False
IsFirstStart = False
Exit Sub
eH:
104 MsgBox Err.Description & vbCrLf & _
"程序 CodeBrowser.Connect.AddinInstance_OnStartupComplete " & _
"错误行 " & Erl, vbCritical, "错误信息"
106 Resume Next
End Sub
Private Sub AddinInstance_Terminate()
On Error GoTo eH
100 Set VBInstance = Nothing
102 If bHostShutdown Then FreeLibrary hModule
Exit Sub
eH:
104 MsgBox Err.Description & vbCrLf & _
"程序 CodeBrowser.Connect.AddinInstance_Terminate " & _
"错误行 " & Erl, vbCritical, "错误信息"
106 Resume Next
End Sub
Private Sub eVBBuildEvents_EnterDesignMode()
On Error GoTo eH
100 bInRunMode = False
AfterRun = True
Exit Sub
eH:
102 MsgBox Err.Description & vbCrLf & _
"程序 CodeBrowser.Connect.eVBBuildEvents_EnterDesignMode " & _
"错误行 " & Erl, vbCritical, "错误信息"
104 Resume Next
End Sub
Private Sub eVBBuildEvents_EnterRunMode()
On Error GoTo eH
100 bInRunMode = True
Exit Sub
eH:
102 MsgBox Err.Description & vbCrLf & _
"程序 CodeBrowser.Connect.eVBBuildEvents_EnterRunMode " & _
"错误行 " & Erl, vbCritical, "错误信息"
104 Resume Next
End Sub
Private Sub eVBComponentsEvents_ItemAdded(ByVal VBComponent As VBIDE.VBComponent)
'Debug.Print "eVBComponentsEvents_ItemAdded " & VBComponent.Name
On Error GoTo eH
100 If bInRunMode Then Exit Sub
102 IsCompLoading = True
Do
104 DoEvents
106 Loop While VBComponent.Type = 0
108 mobjDoc.EV_InsertNewComponent VBComponent.Collection.Parent.Name, VBComponent
110 IsCompLoading = False
Exit Sub
eH:
112 MsgBox Err.Description & vbCrLf & _
"程序 CodeBrowser.Connect.eVBComponentsEvents_ItemAdded " & _
"错误行 " & Erl, vbCritical, "错误信息"
114 Resume Next
End Sub
Private Sub eVBComponentsEvents_ItemReloaded(ByVal VBComponent As VBIDE.VBComponent)
'Debug.Print "eVBComponentsEvents_ItemReloaded " & VBComponent.Name
On Error GoTo eH
100 If bInRunMode Then Exit Sub
102 mobjDoc.L_ResetLists
Exit Sub
eH:
104 MsgBox Err.Description & vbCrLf & _
"程序 CodeBrowser.Connect.eVBComponentsEvents_ItemReloaded " & _
"错误行 " & Erl, vbCritical, "错误信息"
106 Resume Next
End Sub
Private Sub eVBComponentsEvents_ItemRemoved(ByVal VBComponent As VBIDE.VBComponent)
'Debug.Print "eVBComponentsEvents_ItemRemoved " & VBComponent.Name
On Error GoTo eH
Dim sKey$
Const Vb_Sep = "|"
100 If bInRunMode Then Exit Sub
102 If ProcessMsg = True Then ProcessMsg = False
Do
104 DoEvents
106 Loop While VBComponent.Type = 0
108 Select Case VBComponent.Type
Case vbext_ct_ResFile, vbext_ct_RelatedDocument
110 sKey = VBComponent.Collection.Parent.Name & Vb_Sep & VBComponent.FileNames(1)
112 Case Else
114 sKey = VBComponent.Collection.Parent.Name & Vb_Sep & VBComponent.Name & Vb_Sep
End Select
116 mobjDoc.EV_DeleteFromKey sKey
118 DoEvents
120 mobjDoc.L_ResetLists
122 DoEvents
124 If ProcessMsg = False Then ProcessMsg = True
Exit Sub
eH:
126 MsgBox Err.Description & vbCrLf & _
"程序 CodeBrowser.Connect.eVBComponentsEvents_ItemRemoved " & _
"错误行 " & Erl, vbCritical, "错误信息"
128 Resume Next
End Sub
Private Sub eVBComponentsEvents_ItemRenamed(ByVal VBComponent As VBIDE.VBComponent, ByVal OldName As String)
'Debug.Print "eVBComponentsEvents_ItemRenamed " & OldName
On Error GoTo eH
Dim sOldKey$, CompName$, PrjName$, oComp As VBComponent
Const Vb_Sep = "|"
100 If bInRunMode Then Exit Sub
Do
102 DoEvents
104 Loop While VBComponent.Type = 0
106 Set oComp = VBComponent
108 CompName = VBComponent.Name
110 PrjName = oComp.Collection.Parent.Name
112 Select Case VBComponent.Type
Case vbext_ct_ResFile, vbext_ct_RelatedDocument
'handle in filewrite
Exit Sub
114 Case Else
116 sOldKey = VBComponent.Collection.Parent.Name & Vb_Sep & OldName & Vb_Sep
End Select
118 mobjDoc.EV_DeleteFromKey sOldKey
120 DoEvents
122 mobjDoc.EV_InsertNewComponent PrjName, oComp
124 DoEvents
126 mobjDoc.M_RefreshMembers PrjName & Vb_Sep, CompName
128 DoEvents
130 mobjDoc.L_ResetLists
Exit Sub
eH:
132 MsgBox Err.Description & vbCrLf & _
"程序 CodeBrowser.Connect.eVBComponentsEvents_ItemRenamed " & _
"错误行 " & Erl, vbCritical, "错误信息"
134 Resume Next
End Sub
Private Sub eVBControlsEvents_ItemAdded(ByVal VBControl As VBIDE.VBControl)
On Error GoTo eH
100 If bInRunMode Then Exit Sub
106 mobjDoc.bRefreshing = True
108 LockWindowUpdate GetDesktopWindow
110 bControlChange = True
112 mobjDoc.EV_Timer2
114 DoEvents
116 LockWindowUpdate 0
118 mobjDoc.bRefreshing = False
Exit Sub
eH:
MsgBox Err.Description & vbCrLf & _
"程序 CodeBrowser.Connect.eVBControlsEvents_ItemAdded " & _
"错误行 " & Erl & vbCrLf & Err.Number, vbCritical, "错误信息"
Resume Next
End Sub
Private Sub eVBControlsEvents_ItemRemoved(ByVal VBControl As VBIDE.VBControl)
On Error GoTo eH
100 If bInRunMode Then Exit Sub
106 mobjDoc.bRefreshing = True
108 LockWindowUpdate GetDesktopWindow
110 bControlChange = True
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -