Select folder dialog

Share your advanced PureBasic knowledge/code with the community.
User avatar
SPH
Enthusiast
Enthusiast
Posts: 572
Joined: Tue Jan 04, 2011 6:21 pm

Re: Select folder dialog

Post by SPH »

JHPJHP wrote: Mon Sep 08, 2025 4:34 pm

Code: Select all

IncludeFile "includes\CID.pbi"

*ofr.OPEN_FOLDER_REQUESTER = AllocateStructure(OPEN_FOLDER_REQUESTER)

Dim *ofr\AddPlace(2)
*ofr\AddPlace(0)        = GetHomeDirectory()
*ofr\AddPlace(1)        = GetTemporaryDirectory()

*ofr\Title              = "Open Folder Requester"
*ofr\FileNameLabel      = "Folder Name:"
*ofr\OkButtonLabel      = "Open"
*ofr\DefaultFolder      = GetHomeDirectory()
*ofr\DialogOptions      = #FOS_PICKFOLDERS | #FOS_FORCEFILESYSTEM | #FOS_PATHMUSTEXIST | #FOS_DONTADDTORECENT
*ofr\ExtraOption        = #True
*ofr\ExtraOptionEnabled = #True
*ofr\hWndOwner          = #Null

FolderPath$ = OpenFolderRequester(*ofr)

If FolderPath$
  If *ofr\ExtraOption
    If *ofr\ExtraOptionEnabled : ExtraOptionEnabled = #True : EndIf

    ExtraOption$ = #LF$ + #LF$ + "Extra Option: " + ExtraOptionEnabled
  EndIf
  MessageRequester("Open Folder Requester", "Folder Path: " + FolderPath$ + ExtraOption$, #PB_MessageRequester_Info)
EndIf
FreeStructure(*ofr)
Hi,
where can i find "includes\CID.pbi" please ?

thx

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
Post Reply