08-02-2008, 10:30 AM
I cannot debug normally because works well on my computers. Try to use this:
Function BrowseForFolder2
Here i removed the callback function.
Function BrowseForFolder2
;/
function# str&s [$initdir] [flags] [$text] ;;flags: 1 include files, 2 include non-file objects (Control Panel, etc), 4 new style
;Displays "Browse For Folder" dialog and stores full path of selected folder into s.
;Returns a nonzero value on OK, 0 on Cancel.
;flags may also include one or more of BIF_x flags (declared in WINAPI), lshifted by 8 bits. For example, to browse for computer, use 2|(0x1000<<8). For more info, search for SHBrowseForFolder in the MSDN Library.
;EXAMPLE
;str s
;if(BrowseForFolder2(s "$windows$")) out s
BROWSEINFOW b
b.hwndOwner=win()
if(flags&1) b.ulFlags|BIF_BROWSEINCLUDEFILES
if(flags&2=0) b.ulFlags|BIF_RETURNONLYFSDIRS
if(flags&4) b.ulFlags|BIF_USENEWUI
b.ulFlags|flags>>8
b.lpszTitle=@text
;if(flags&4)
,;STRINT p.i=flags; p.s.searchpath(initdir)
,;b.lpfn=&BFF_Callback; b.lParam=&p
;else
,if(len(initdir)) b.pidlRoot=PidlFromStr(initdir)
ITEMIDLIST* pidl=SHBrowseForFolderW(&b)
if(pidl) PidlToStr(pidl &s flags&2=0); CoTaskMemFree pidl; else s.all
if(b.pidlRoot) CoTaskMemFree b.pidlRoot
0
ret s.len
Here i removed the callback function.