在VB中如何打开“文件夹选项”对话框?
查了一下打开控制面板的文章,但没有提到能打开“文件夹选项”对话框,还望高人指点一下。 问题点数:20、回复次数:10Top
1 楼danielinbiti(金)回复于 2006-04-24 21:38:43 得分 0
引用Microsoft common dialog control6.0控件Top
2 楼VBAHZ(凌云(E文词汇量580))回复于 2006-04-24 22:57:13 得分 0
然后呢?
Top
3 楼jiangsheng(蒋晟.Net[MVP])回复于 2006-04-25 04:40:52 得分 15
Shell("rundll32.exe shell32.dll,Options_RunDLL 0", 1)
Top
4 楼ZOU_SEAFARER(颓废程序员^_^)回复于 2006-04-25 08:15:16 得分 1
Private Type BrowseInfo
hWndOwner As Long
pIDLRoot As Long
pszDisplayName As Long
lpszTitle As Long
ulFlags As Long
lpfnCallback As Long
lParam As Long
iImage As Long
End Type
Const BIF_RETURNONLYFSDIRS = 1
Const MAX_PATH = 260
Private Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal hMem As Long)
Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long
Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As Long, ByVal lpBuffer As String) As Long
Private Sub Form_Load()
Dim iNull As Integer, lpIDList As Long, lResult As Long
Dim sPath As String, udtBI As BrowseInfo
With udtBI
'Set the owner window
.hWndOwner = Me.hWnd
'lstrcat appends the two strings and returns the memory address
.lpszTitle = lstrcat("请选择文件夹", "") '标题
'Return only if the user selected a directory
.ulFlags = BIF_RETURNONLYFSDIRS
End With
'Show the 'Browse for folder' dialog
lpIDList = SHBrowseForFolder(udtBI)
If lpIDList Then
sPath = String$(MAX_PATH, 0)
'Get the path from the IDList
SHGetPathFromIDList lpIDList, sPath
'free the block of memory
CoTaskMemFree lpIDList
iNull = InStr(sPath, vbNullChar)
If iNull Then
sPath = Left$(sPath, iNull - 1)
End If
End If
MsgBox sPath
End Sub
Top
5 楼hank212(IT民工)回复于 2006-04-25 08:19:47 得分 1
樓主說的好像是資源管理器期->工具->文件夾選項 吧.Top
6 楼VBAHZ(凌云(E文词汇量580))回复于 2006-04-25 22:06:19 得分 1
除了 jiangsheng(蒋晟.Net[MVP]) 老大,
还有谁看到 “选项” 二字???
Top
7 楼northwolves(狼行天下)回复于 2006-04-25 22:55:55 得分 1
蒋老大厉害
我只知道打开任务栏是 Shell "Rundll32.exe shell32.dll,Options_RunDLL 1", 最后的参数试
了2,3,4 惟独没有试0,可惜.Top
8 楼leihr(秋风)回复于 2006-04-26 17:43:01 得分 0
不错,长进了!
Top
9 楼HtoFire(冬天里的一把火)回复于 2006-05-22 13:12:50 得分 0
厉害,谢了~~Top
10 楼hank212(IT民工)回复于 2006-05-22 14:34:31 得分 1
http://www.yesky.com/20000927/118452.shtmlTop




