没有合适的资源?快使用搜索试试~ 我知道了~
精彩编程与编程技巧-往列表框中填入文件目录信息...
需积分: 9 2 下载量 161 浏览量
2009-10-08
02:25:46
上传
评论
收藏 3KB TXT 举报
温馨提示
试读
3页
精彩编程与编程技巧-往列表框中填入文件目录信息 ...
资源推荐
资源详情
资源评论
吏双燕崇嶄野秘猟周朕村佚連
This routine demonstrated using the API and a standard listbox to duplicate the functionality of a FileList Box. By using this method over the FileListBox, you can control the files, directories and drives displayed.
Note however that the constant value for 'READWRITE' is 0, the same as the vb constant 'Archive'. In VB you can not mask out the archive files to only return hidden files (for example). But by using the API value DDL_EXCLUSIVE Or'd with the type to be listed, you have control over the display of files.
The added bonus is that this method is instantaneous.
Add the following code to a BAS module:
---------------------------------------------------------------
Public Declare Function SendMessageStr Lib _
"user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As String) As Long
Public Declare Function SendMessageLong Lib _
"user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Public Const LB_DIR = &H18D
Public Const LB_RESETCONTENT = &H184
Public Const DDL_READWRITE = &H0
This routine demonstrated using the API and a standard listbox to duplicate the functionality of a FileList Box. By using this method over the FileListBox, you can control the files, directories and drives displayed.
Note however that the constant value for 'READWRITE' is 0, the same as the vb constant 'Archive'. In VB you can not mask out the archive files to only return hidden files (for example). But by using the API value DDL_EXCLUSIVE Or'd with the type to be listed, you have control over the display of files.
The added bonus is that this method is instantaneous.
Add the following code to a BAS module:
---------------------------------------------------------------
Public Declare Function SendMessageStr Lib _
"user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As String) As Long
Public Declare Function SendMessageLong Lib _
"user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Public Const LB_DIR = &H18D
Public Const LB_RESETCONTENT = &H184
Public Const DDL_READWRITE = &H0
资源评论
求伯乐
- 粉丝: 22
- 资源: 3095
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功