Folder Dialog

In this category you can exchange your programming questions and solutions.
Post Reply
Darren
Posts: 63
Joined: Wed May 11, 2011 11:55 am

Folder Dialog

Post: # 1058Post Darren
Wed Apr 10, 2013 9:29 am

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

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

Folder Dialog

Post: # 1059Post Marco
Fri Apr 26, 2013 9:00 pm

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")

Post Reply