Why not use Windows API
I don't have a complete breakout, but here is a snippet and a forum link I used.
You can edit the OFN_HookFunc() to meet your needs.
http://www.purebasic.fr/english/viewtop ... 85#p111485
...snippet...
Code: Select all
Protected myOFN.OPENFILENAME
myOFN\hwndOwner = hW
myOFN\lStructSize = SizeOf(OPENFILENAME) + 12 ; #OSVEX_LENGTH = 88
myOFN\hInstance = #Null
myOFN\lpstrFilter = @*p\Pattern$
myOFN\lpstrCustomFilter = #Null
myOFN\nMaxCustFilter = #Null
myOFN\nFilterIndex = *p\patternPos
myOFN\lpstrFile = *selectedFile
myOFN\nMaxFile = bufferSize
myOFN\lpstrFileTitle = #Null
myOFN\nMaxFileTitle = #Null
myOFN\lpstrInitialDir = @*p\DefFilePath$
myOFN\lpstrTitle = @*p\Title$
myOFN\flags = #OFS_FILE_OPEN_FLAGS | #OFN_ENABLEHOOK | #OFN_ENABLESIZING
myOFN\lpfnHook = @OFN_HookFunc()
If *p\multiSelect
myOFN\flags | #OFN_ALLOWMULTISELECT
EndIf
GetOpenFileName_(@myOFN)
Procedure OFN_HookFunc(hW, msg, wP, lP)
Protected.i hParent, hLV, ri
Select msg
; Uncomment the following to allow repositioning/resizing the dialog
; Case Dlg_Move
; ; Resize the dialog window
; hParent = GetParent_(hW)
; MoveWindow_(hParent, 0, 0, wP, lP, 1)
; Case #WM_INITDIALOG
; ; wd, ht
; PostMessage_(hW, Dlg_Move, 800, 600)
Case #WM_NOTIFY
; hW is the handle to the dialog
; hParent is the handle to the common control
; hLV is the handle to the listview itself
hParent = GetParent_(hW)
hLV = FindWindowEx_(hParent, 0, "SHELLDLL_DefView", #NULL$)
If hLV
ri = SendMessage_(hLV, #WM_COMMAND, #OFN_VIEW_REPORT, #Null)
EndIf
EndSelect
ProcedureReturn 0
EndProcedure
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum