Hi all,
I use Edwin's BFF to browse for a certain folder.
When opening the listview, I want to be able to specify a certain folder that is shown.
I can do it with following line:
Trouble is that this way, I can't go to another (network)drive. Only c:\ is accessible.
With the next line:
all drives are accessible, but I can't specify a certain folder that is shown..
I would like a combination of the two, something like:
but this doesn't work... It is the same as the second line.
Does anybody know how to do this?
Kind regards
Eddy
------------------
[email protected]
[This message has been edited by Eddy Van Esch (edited August 28, 2001).]
I use Edwin's BFF to browse for a certain folder.
When opening the listview, I want to be able to specify a certain folder that is shown.
I can do it with following line:
Code:
'// Populate the treeview with the specified rootfolder. BFF_Path hWndc, "c:\", 0, 1
With the next line:
Code:
BFF_Path hWndc, "", %CSIDL_DESKTOP, 0
I would like a combination of the two, something like:
Code:
BFF_Path hWndc, "c:\Program Files\", %CSIDL_DESKTOP, 0
Does anybody know how to do this?
Kind regards
Eddy
Code:
#COMPILE EXE '%DEBUGMODE = 1 '#INCLUDE "DEBUGDLL.INC" %NOANIMATE = 1 %NOBUTTON = 1 %NOCOMBO = 1 %NODATETIMEPICK = 1 %NODRAGLIST = 1 %NOHEADER = 1 %NOHOTKEY = 1 %NOIMAGELIST = 1 %NOPIADDRESS = 1 %NOLIST = 1 %NOLISTVIEW = 1 %NOMONTHCAL = 1 %NONATIVEFONTCTL = 1 %NOPAGESCROLLER = 1 %NOPAGESCROLLER = 1 %NOPROGRESS = 1 %NOREBAR = 1 %NOSTATUSBAR = 1 %NOTABCONTROL = 1 %NOTOOLBAR = 1 %NOTOOLTIPS = 1 %NOTRACKBAR = 1 '%NOTREEVIEW = 1 %NOUPDOWN = 1 DECLARE FUNCTION CoTaskMemAlloc LIB "ole32.dll" ALIAS "CoTaskMemAlloc"( BYVAL cb AS DWORD ) AS DWORD DECLARE SUB CoTaskMemFree LIB "ole32.dll" ALIAS "CoTaskMemFree"( BYVAL pv AS DWORD PTR ) 'DECLARE FUNCTION CoInitialize LIB "ole32.dll" ALIAS "CoInitialize"( BYVAL pvReserved AS DWORD ) AS DWORD 'DECLARE SUB CoUninitialize LIB "ole32.dll" ALIAS "CoUninitialize" DECLARE FUNCTION SHGetDesktopFolder LIB "Shell32.Dll" ALIAS "SHGetDesktopFolder"( ppshf AS ANY ) AS LONG DECLARE FUNCTION SelectDir AS STRING #INCLUDE "win32api.inc" #INCLUDE "Commctrl.inc" #INCLUDE "BFF.INC" %ID_BFF1 = 100 %BFF_OK = 10 %BFF_Cancel = 11 GLOBAL SelDir_hDlg AS LONG GLOBAL SelDir_DirName AS STRING FUNCTION PBMAIN AS LONG 'debug_print SelectDir SLEEP 6000 END FUNCTION '------------------------------------------ 'Callback routine for the directory selection dialog '------------------------------------------ CALLBACK FUNCTION DlgProc() AS LONG DIM lResult AS LONG DIM xx AS LONG, yy AS LONG DIM cwidth AS LONG DIM cheight AS LONG SELECT CASE CBMSG CASE %WM_DESTROY CASE %WM_NOTIFY '// A few messages need to be maintained for the BFF treeview. lResult = BFF_WM_NOTIFY( CBHNDL, CBWPARAM, BYVAL CBLPARAM ) IF lResult THEN FUNCTION = lResult: EXIT FUNCTION '// If you like, you can retrieve the user's interaction using this procedure. lResult = BFF_SelChanged( GetDlgItem( CBHNDL, %ID_BFF1 ), CBLPARAM ) IF lResult THEN '// Your code... SetWindowText CBHNDL, BFF_GetPath( GetDlgItem( CBHNDL, %ID_BFF1 ) ) SelDir_DirName = BFF_GetPath( GetDlgItem( CBHNDL, %ID_BFF1 ) ) END IF CASE %WM_SIZE DIALOG GET CLIENT SelDir_hDlg TO cwidth, cheight DIALOG UNITS SelDir_hDlg, cwidth, cheight TO PIXELS xx, yy MoveWindow GetDlgItem( CBHNDL, %ID_BFF1 ), 5, 5, xx-10, yy-40, -1 CONTROL SET LOC CBHNDL, %BFF_OK, 5, cheight-18 CONTROL SET LOC CBHNDL, %BFF_Cancel, 70, cheight-18 CASE %WM_GETMINMAXINFO RV&=DefWindowProc(CBHNDL, CBMSG, CBWPARAM, CBLPARAM) DIM MM AS MINMAXINFO PTR MM=CBLPARAM @MM.ptMinTrackSize.x=210 @MM.ptMinTrackSize.y=200 END SELECT END FUNCTION '------------------------------------------ 'SelectDir opens a dialog to select a directory and returns it as a string '------------------------------------------ FUNCTION SelectDir AS STRING DIM hWndc AS LONG DIM ExpandItem AS LONG DIM cwidth AS LONG DIM cheight AS LONG DIALOG NEW 0, "Select a directory",,, 200, 220, %WS_SYSMENU OR %WS_THICKFRAME TO SelDir_hDlg IF SelDir_hDlg = 0 THEN EXIT FUNCTION '// Create the BFF control. DIALOG GET SIZE SelDir_hDlg TO cwidth, cheight DIALOG UNITS SelDir_hDlg, cwidth-10, cheight-45 TO PIXELS xx&, yy& ExpandItem = 1 hWndc = BFF_CreateTreeview( _ SelDir_hDlg _ , %ID_BFF1 _ , %WS_VISIBLE OR %WS_TABSTOP _ , %WS_EX_CLIENTEDGE _ , 5, 5, xx&, yy& _ , ExpandItem ) '// Discard (default) current selection and set a new one. '// Populate the treeview with drives only. ' BFF_Path hWndc, "", %CSIDL_NOID, 0 '// Populate the treeview with the specified rootfolder. 'BFF_Path hWndc, "g:\", 0, 1 BFF_Path hWndc, "c:\", %CSIDL_DESKTOP, 0 CONTROL ADD BUTTON, SelDir_hDlg, %BFF_OK, "OK", 5, cheight-35, 60, 15, _ %WS_CHILD OR %WS_VISIBLE OR %BS_PUSHBUTTON OR %WS_TABSTOP CONTROL ADD BUTTON, SelDir_hDlg, %BFF_Cancel, "Cancel", 70, cheight-35, 60, 15, _ %WS_CHILD OR %WS_VISIBLE OR %BS_PUSHBUTTON OR %WS_TABSTOP DIALOG SHOW MODAL SelDir_hDlg CALL DlgProc 'debug_print SelDir_DirName FUNCTION = SelDir_DirName END FUNCTION
[email protected]
[This message has been edited by Eddy Van Esch (edited August 28, 2001).]
Comment