Page 1 of 1

Folder Dialog

Posted: Wed Apr 10, 2013 9:29 am
by Darren
Does anybody know how I can call the "browse for folder" dialog using an FnxBasic API call?

Please see the folowing link for a picture of "browse for folder" dialog

http://www.functionx.com/bcb/controls/browsefolder.htm

Regards

Darren

Folder Dialog

Posted: Fri Apr 26, 2013 9:00 pm
by Marco
hi, something like this?

`Example browse for folder

record BrowseInfo
  hWndOwner As Long
  pIDLRoot As Long
  pszDisplayName As Long
  lpszTitle As Long
  ulFlags As Long
  lpfnCallback As Long
  lParam As Long
  iImage as long
end record

Declare getpath as "SHGetPathFromIDList" of "shell32"
  pidList As Long
  lpBuffer As String byaddress
  result As Long
end declare

Declare browse as "SHBrowseForFolder" of "shell32"
  info As BrowseInfo
  result as long
end declare


function browsefolder(title as string) as string
  Const BIF_RETURNONLYFSDIRS=1
  result=""
  browse.info.lpszTitle = varptr(title)
  browse.info.ulFlags = BIF_RETURNONLYFSDIRS
  browse.execute
  If browse.result>0 then
    getpath.pidlist=browse.result
    getpath.execute
    result=getpath.lpbuffer
  end If
end function

showmessage browsefolder("Select a folder")