⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modbrowsefolder.bas

📁 这是一个完美版本的的超强文件编辑器,支持各种程序的语法高亮,支持插件和宏录制,支持XP菜单,支持浏览器浏览等等功能,记得有位网友做文件编辑器要求我给他一个支持语法高亮和DockWindows技术的代码
💻 BAS
字号:
Attribute VB_Name = "modBrowseFolder"
'****************************************************************************
'人人为我,我为人人
'枕善居汉化收藏整理
'发布日期:05/06/19
'描  述:完整版本的超强文件编辑器
'网  站:http://www.mndsoft.com/
'e-mail:mnd@mndsoft.com
'OICQ  : 88382850
'****************************************************************************
'----------------------------------------------------------------
'
'                Browse for folders in VB5
'
'              written by D. Rijmenants 2004
'
'----------------------------------------------------------------
'
' This module enables you to get use the browse dialog to select
' a folder in vb5. Only one functionis required.  As you call
' the function, the browse dialog pops up. Easy to apply !
'
' return = BrowseFolder(Title, MyForm)
'
' Where:
'
' Title  (string) is the title you want to display on the dialog
' MyForm (form) is the form on wich you call the dialog
' return (string) the path of the selected folder after pressing OK
'
' Note: if cancel is selected, the dialog will return
'       an empty string !
'
'
' That's all folks...
'
' Comments or suggestions are most welcome at
' mail: dr.defcom@telenet.be
'
'----------------------------------------------------------------
Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Declare Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
Type BROWSEINFO
     hOwner As Long
     pidlRoot As Long
     pszDisplayName As String
     lpszTitle As String
     ulFlags As Long
     lpfn As Long
     lParam As Long
     iImage As Long
End Type

Public Function BrowseFolder(ByVal aTitle As String, ByVal aForm As Form) As String
Dim bInfo As BROWSEINFO
Dim rtn&, pidl&, path$, pos%
Dim BrowsePath As String
bInfo.hOwner = aForm.hwnd
bInfo.lpszTitle = aTitle
'the type of folder(s) to return
bInfo.ulFlags = &H1
'show the dialog box
pidl& = SHBrowseForFolder(bInfo)
'set the maximum characters
path = Space(512)
'get the selected path
t = SHGetPathFromIDList(ByVal pidl&, ByVal path)
pos% = InStr(path$, Chr$(0)) 'extracts the path from the string
'set the extracted path to SpecIn
BrowseFolder = Left(path$, pos - 1)
'clean up the path string
If Right$(Browse, 1) = "\" Then
    BrowseFolder = BrowseFolder
    Else
    BrowseFolder = BrowseFolder + "\"
End If
If Right(BrowseFolder, 2) = "\\" Then BrowseFolder = Left(BrowseFolder, Len(BrowseFolder) - 1)
If BrowseFolder = "\" Then BrowseFolder = ""
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -