How to call the browse path dialog

zhaozj2021-02-11  238

Win32API's ShellExtension shell extension provides this way. Here is a C language

The written program can display the dialog shown above. VoidselectDirdlg (Chardir [])

{

Browseinfobi;

ItemidList * PIDL;

bi.hwndowner = null;

Bi.PIDLROOT = NULL;

Bi.pszdisplayName = DIR;

Bi.lpsztitle = "Selectadirectory";

Bi.ulflags = Bif_Returnonlyfsdirs;

bi.lpfn = null;

bi.lparam = 0;

bi.iimage = 0;

PIDL = shbrowseforfolder (& BI); / * Display "SelectFolder" DIA

Logbox, Getthe

FoldernameAndConvertit

INTOAITEMLIST

DataStructure. * /

IF (PIDL == Null)

DIR [0] = 0;

IF (! SHGETPATHFROMIDLIST (PIDL, DIR)) / * RetrieveFoldernam

efromitemlist

Structure. * /

DIR [0] = 0;

}

转载请注明原文地址:https://www.9cbs.com/read-4106.html

New Post(0)