//头文件
#include <shlobj.h>
//函数原型
BOOL SHGetSpecialFolderPath(HWND hwndOwner, //可用GetDesktopWindow API取一个窗口句柄或直接传NULL.
LPTSTR lpszPath, //返回路径的缓冲区
int nFolder, //标识代号
BOOL fCreate); //true :如果文件夹不存在则创建, false:不创建
//nFolder宏定义
#define CSIDL_DESKTOP 0x0000
#define CSIDL_INTERNET 0x0001
#define CSIDL_PROGRAMS 0x0002
#define CSIDL_CONTROLS 0x0003
#define CSIDL_PRINTERS 0x0004
#define CSIDL_PERSONAL 0x0005
#define CSIDL_FAVORITES 0x0006
#define CSIDL_STARTUP 0x0007
#define CSIDL_RECENT 0x0008
#define CSIDL_SENDTO 0x0009
#define CSIDL_BITBUCKET 0x000a
#define CSIDL_STARTMENU 0x000b
#define CSIDL_DESKTOPDIRECTORY 0x0010
#define CSIDL_DRIVES 0x0011
#define CSIDL_NETWORK 0x0012
#def
【C++学习笔记】返回桌面等特系统殊路径地址 —> SHGetSpecialFolderPath
最新推荐文章于 2023-08-14 17:51:52 发布