Simple Directory Selection Box

xiaoxiao2021-03-06  37

// Select the directory

CHAR PATHNAME [MAX_PATH];

Browseinfo Bi;

bi.hwndowner = null;

Bi.PIDLROOT = NULL;

bi.pszdisplayName = pathname;

Bi.lpsztitle = "Specifies the directory where book data is stored:";

Bi.ulflags = Bif_Returnonlyfsdirs;

bi.lpfn = null;

LpitemidList PIDL = SHBROWSEFORFOLDER (& BI);

IF (PIDL! = NULL)

{

IF (ShgetPathFromidList (PIDL, Pathname))

{

LPMalloc PMalloc;

Shgetmalloc (& pmalloc);

PMalloc-> Free (PIDL);

SDATAPATH = Pathname;

m_reg.writestring (_T ("DataPath"), SDATAPATH);

}

}

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

New Post(0)