Thanks to this code of TATANAS, i can now open the real FolderRequester of windows
Code: Select all
Interface IFileOpenDialog
QueryInterface(riid,ppvObject)
AddRef()
Release()
Show(hwndOwner)
SetFileTypes(cFileTypes,rgFilterSpec)
SetFileTypeIndex(iFileType)
GetFileTypeIndex(piFileType)
Advise(pfde,pdwCookie)
Unadvise(dwCookie)
SetOptions(fos)
GetOptions(pfos)
SetDefaultFolder(psi)
SetFolder(psi)
GetFolder(ppsi)
GetCurrentSelection(ppsi)
SetFileName(pszName)
GetFileName(pszName)
SetTitle(pszTitle)
SetOkButtonLabel(pszText)
SetFileNameLabel(pszLabel)
GetResult(ppsi)
AddPlace(psi,fdap)
SetDefaultExtension(pszDefaultExtension)
Close(hr)
SetClientGuid(guid)
ClearClientData()
SetFilter(pFilter)
GetResults(ppenum)
GetSelectedItems(ppsai)
EndInterface
Define pFOD.IFileOpenDialog
Define pSI.IShellItem
Define buffer.i
Define folder$
CoInitialize_(#Null)
If CoCreateInstance_(?CLSID_IFileOpenDialog, #Null, 1, ?IID_IFileOpenDialog, @pFOD) = #S_OK
pFOD\SetOptions($40|$20)
If pFOD\Show(0) = #S_OK
pFOD\GetResult(@pSI)
pSI\GetDisplayName($80058000, @buffer)
folder$ = PeekS(buffer, -1, #PB_Unicode)
CoTaskMemFree_(buffer)
EndIf
pFOD\Release()
EndIf
CoUninitialize_()
DataSection
CLSID_IFileOpenDialog:
Data.b $9C,$5A,$1C,$DC,$8A,$E8,$DE,$4D,$A5,$A1,$60,$F8,$2A,$20,$AE,$F7
IID_IFileOpenDialog:
Data.b $88,$72,$7C,$D5,$AD,$D4,$68,$47,$BE,$02,$9D,$96,$95,$32,$D9,$60
EndDataSection
I have try to change the CurrentDirectory with PB but that not works
Code: Select all
OldCurrentFolder$ = GetCurrentDirectory()
SetCurrentDirectory("C:\Windows\")
........
.........
SetCurrentDirectory(OldCurrentFolder$)
Have a good day