In the Browse folder dialog box generated by "browseinfo", we found that the project "create folder" was not found. In my program, you need to create a new folder and save it to the folder you just created. Of course, you can also create a directory in the specified directory and select from here. After all, you have to return the drive letter to the folder where you want to create the folder. It is convenient to create a folder at any time, as shown in the SAVE folder. As a result, the following code can be used for personal needs:
# Define bif_newdialogstyle 0x0040
# Define bif_usenewui (bif_newdialogstyle | bif_editbox)
Void selectfolder (hwnd, cstring & strselectpath)
{
Browseinfo Bi;
Char filename [max_path];
Zeromemory (& BI, sizeof (browseinfo ));
Bi. hwndowner = hwnd;
Bi. pszdisplayname = filename;
Bi. lpsztitle = "select folder ";
Bi. ulflags = bif_usenewui;
Lpitemidlist IDL = shbrowseforfolder (& BI );
If (IDL = NULL)
Return;
Shgetpathfromidlist (IDL, filename );
}
Here is the option for adding new Folder:
# Define bif_usenewui (bif_newdialogstyle | bif_editbox)
In the past, only bif_newdialogstyle was used, and a macro was defined by myself, so that the bifeditbox and the above would be OK. Try it on your own.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/mafeichao/archive/2008/08/06/2779017.aspx