This is just more curiosity than anything.
The function below does a nice job of browsefor folder, great, but in Win2k I'm seeing where the OS uses this to brose for a file.
Is there a flag that is missing here that allows it to do that?
------------------
Scott
The function below does a nice job of browsefor folder, great, but in Win2k I'm seeing where the OS uses this to brose for a file.
Is there a flag that is missing here that allows it to do that?
Code:
'--<For the Browse for folder routines---------------------------------------------- %bif_returnonlyfsdirs = &h0001 %bif_dontgobelowdomain = &h0002 %bif_statustext = &h0004 %bif_returnfsancestors = &h0008 %bif_browseforcomputer = &h1000 %bif_browseforprinter = &h2000 %bffm_initialized = 1 %bffm_selchanged = 2 %bffm_setstatustext = %WM_USER + 100 %bffm_enableok = %WM_USER + 101 %bffm_setselection = %WM_USER + 102 ' ' ' Function BrowseForFolder(hWnd As Long, Title As String,StartDir As String) Export As String Local zbuffer As Asciiz * %max_path Local zstartdir As Asciiz * %max_path Local bi As browseinfo zstartdir = StartDir bi.hwndowner = hWnd bi.lpsztitle = StrPtr(Title) bi.ulflags = %bif_returnonlyfsdirs Or %bif_dontgobelowdomain Or %bif_statustext bi.pidlroot = 0 bi.lpfncallback = CodePtr(fbrowseproc) bi.lparam = VarPtr(zstartdir) lpidlist& = shbrowseforfolder(bi) If lpidlist& Then shgetpathfromidlist lpidlist&, zbuffer Function = zbuffer Else Function = "" End If End Function '--------------------------------------------------------- '------------------------------------------------------------------------------------------ Function fbrowseproc(ByVal hwnd&,ByVal msg&,ByVal a&,ByVal startdir&)Export As Long Static zdir As Asciiz*%max_path Select Case msg& Case %bffm_initialized sendmessage hwnd&,%bffm_setselection,%true,startdir& Case %bffm_selchanged If shgetpathfromidlist(a&,ByVal VarPtr(zdir)) Then sendmessage hwnd&,%bffm_setstatustext,0,ByVal VarPtr(zdir) End If End Select Function = 0 End Function '-----------------------------------------------------------------------------------------
Scott
Comment