I have this code from the forum. It works, but I would very much like to remove
the %wm_user declarations:
%bffm_setstatustext=%wm_user+100
%bffm_setselection=%wm_user+102
I just cant figure out whats going on with the line
tbi.lpfncallback = CODEPTR(fbrowseproc) ' wassis all about?
I want to loose the Callback function? fbrowseproc alltogether
but when I do it no longer goes to my startdir.
How do I do this pls?
------------------
Kind Regards
Mike
[This message has been edited by Mike Trader (edited July 05, 2001).]
the %wm_user declarations:
%bffm_setstatustext=%wm_user+100
%bffm_setselection=%wm_user+102
I just cant figure out whats going on with the line
tbi.lpfncallback = CODEPTR(fbrowseproc) ' wassis all about?
I want to loose the Callback function? fbrowseproc alltogether
but when I do it no longer goes to my startdir.
How do I do this pls?

Code:
TYPE browseinfo hwndowner AS LONG pidlroot AS LONG pszdisplayname AS ASCIIZ PTR lpsztitle AS ASCIIZ PTR ulflags AS LONG lpfncallback AS LONG lparam AS LONG iimage AS LONG END TYPE 'Why dont I need these when i #INCLUDE "WIN32API.INC"??? 'DECLARE FUNCTION SHBROWSEFORFOLDER LIB "SHELL32.DLL" ALIAS "SHBrowseForFolder" (lpbi AS BrowseInfo) AS LONG 'DECLARE FUNCTION SHGETPATHFROMIDLIST LIB "SHELL32.DLL" ALIAS "SHGetPathFromIDList" (BYVAL pidList AS LONG, BYVAL lpBuffer AS LONG) AS LONG %bffm_setstatustext=%wm_user+100 %bffm_setselection=%wm_user+102 '----------------------------------------------------------------------------------------------------- FUNCTION FolderDialog(hwnd AS LONG, title AS STRING, Dir AS ASCIIZ*%max_path ) AS LONG LOCAL zbuffer AS ASCIIZ*%max_path LOCAL lpidlist AS LONG LOCAL zstartdir AS ASCIIZ*%max_path LOCAL tbi AS browseinfo tbi.hwndowner = hwnd tbi.lpsztitle = STRPTR(title) zstartdir = Dir tbi.ulflags = &h0001 OR &h0002 OR &h0004 tbi.pidlroot = 0 tbi.lpfncallback = CODEPTR(fbrowseproc) ' wassis all about? tbi.lparam = VARPTR(zstartdir) lpidlist = SHBROWSEFORFOLDER(tbi) IF lpidlist THEN zBuffer = SPACE$(256) CALL SHGETPATHFROMIDLIST (lpidlist&, Dir) ' Return the path 'Dir = LEFT$(Buffer, INSTR(Buffer, CHR$(0)) - 1) FUNCTION = lpidlist END IF MSGBOX zstartdir END FUNCTION '----------------------------------------------------------------------------------------------------- FUNCTION fbrowseproc(BYVAL hwnd&, BYVAL msg&, BYVAL a&, BYVAL startdir&) AS LONG ' i wanna loose this alltogether STATIC zdir AS ASCIIZ*%max_path SELECT CASE msg& CASE 1 SENDMESSAGE hwnd&, %bffm_setselection, %true, startdir& CASE 2 IF SHGETPATHFROMIDLIST(a&,BYVAL VARPTR(zdir)) THEN SENDMESSAGE hwnd&, %bffm_setstatustext, 0, BYVAL VARPTR(zdir) END IF END SELECT FUNCTION=0 END FUNCTION '************************************************************************
Kind Regards
Mike
[This message has been edited by Mike Trader (edited July 05, 2001).]
Comment