Home
 | 
Programs
 | 
Tips & Tricks
 | 
Subs & Functions
 | 
Links
 | 
Laz's Liberty Basic Site
'Function for Browsing folders
'For LB3.x
'by ~laz on 7-17-02
Folder$ = BrowseFolders$()
if Folder$ <> "" then
print Folder$
else
print "Cancel Pressed"
end if
wait
Function BrowseFolders$()
struct BrowseInfo, _
hWnd as long, _
Root as long, _
DName$ as ptr, _
Title$ as ptr, _
Flags as long, _
lpfn as long, _
lParam as long, _
iImage as long
calldll #shell32, "SHBrowseForFolder", _
BrowseInfo as struct, ID as long
Path$ = space$(256)+chr$(0)
calldll #shell32, "SHGetPathFromIDList", _
ID as long, _
Path$ as ptr, _
ret as boolean
BrowseFolders$ = trim$(Path$)
open "ole32.dll" for dll as #ole32
calldll #ole32, "CoTaskMemFree", _
ID as long, _
ret as void
close #ole32
end function