VC获取操作系统特殊路径的方法
作者:网络转载 发布时间:[ 2013/9/27 15:17:14 ] 推荐标签:
BOOL SHGetSpecialFolderPath ( HWND hwndOwner, LPTSTR lpszPath, int nFolder, BOOL fCreate);
hwndOwner :用GetDesktopWindow API取一个窗口句柄。
lpszPath:返回的路径
nFolder:标识代号
fCreate:true :如果文件夹不存在则创建,false:不创建
lpszPath和nFolder对应关系:
nFolder lpszPath
0 C:/Documents and Settings/当前用户/桌面
2 C:/Documents and Settings/当前用户/「开始」菜单/程序
5 C:/Documents and Settings/当前用户/My Documents
6 C:/Documents and Settings/当前用户/Favorites
7 C:/Documents and Settings/当前用户/「开始」菜单/程序/启动
8 C:/Documents and Settings/当前用户/Recent
9 C:/Documents and Settings/当前用户/SendTo
11 C:/Documents and Settings/当前用户/「开始」菜单
13 C:/Documents and Settings/当前用户/My Documents/My Music
14 C:/Documents and Settings/当前用户/My Documents/My Videos
16 C:/Documents and Settings/当前用户/桌面
19 C:/Documents and Settings/当前用户/NetHood
20 C:/WINDOWS/Fonts
21 C:/Documents and Settings/当前用户/Templates
22 C:/Documents and Settings/All Users/「开始」菜单
23 C:/Documents and Settings/All Users/「开始」菜单/程序
24 C:/Documents and Settings/All Users/「开始」菜单/程序/启动
25 C:/Documents and Settings/All Users/桌面
26 C:/Documents and Settings/当前用户/Application Data
27 C:/Documents and Settings/当前用户/PrintHood
28 C:/Documents and Settings/当前用户/Local Settings/Application Data
31 C:/Documents and Settings/All Users/Favorites
32 C:/Documents and Settings/当前用户/Local Settings/Temporary Internet Files
33 C:/Documents and Settings/当前用户/Cookies
34 C:/Documents and Settings/当前用户/Local Settings/History
35 C:/Documents and Settings/All Users/Application Data
36 C:/WINDOWS
37 C:/WINDOWS/system32
38 C:/Program Files
39 C:/Documents and Settings/当前用户/My Documents/My Pictures
40 C:/Documents and Settings/当前用户
43 C:/Program Files/Common Files
45 C:/Documents and Settings/All Users/Templates
46 C:/Documents and Settings/All Users/Documents
47 C:/Documents and Settings/All Users/「开始」菜单/程序/管理工具
48 C:/Documents and Settings/当前用户/「开始」菜单/程序/管理工具
53 C:/Documents and Settings/All Users/Documents/My Music
54 C:/Documents and Settings/All Users/Documents/My Pictures
55 C:/Documents and Settings/All Users/Documents/My Videos
56 C:/WINDOWS/resources
59 C:/Documents and Settings/当前用户/Local Settings/Application Data/Microsoft/CD Burning
|
在vc6.0中只定义了一下的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
#define CSIDL_NETHOOD 0x0013
#define CSIDL_FONTS 0x0014
#define CSIDL_TEMPLATES 0x0015
#define CSIDL_COMMON_STARTMENU 0x0016
#define CSIDL_COMMON_PROGRAMS 0X0017
#define CSIDL_COMMON_STARTUP 0x0018
#define CSIDL_COMMON_DESKTOPDIRECTORY 0x0019
#define CSIDL_APPDATA 0x001a
#define CSIDL_PRINTHOOD 0x001b
#define CSIDL_ALTSTARTUP 0x001d // DBCS
#define CSIDL_COMMON_ALTSTARTUP 0x001e // DBCS
#define CSIDL_COMMON_FAVORITES 0x001f
#define CSIDL_INTERNET_CACHE 0x0020
#define CSIDL_COOKIES 0x0021
#define CSIDL_HISTORY 0x0022
|
本文内容不用于商业目的,如涉及知识产权问题,请权利人联系SPASVO小编(021-61079698-8054),我们将立即处理,马上删除。
相关推荐
Asp.net MVC如何对所有用户输入的字符串字段做Trim处理对Spring MVC做单元测试ASP.NET MVC必须知道的那些事!Spring MVC REST异常处理佳实践(下)Spring MVC REST异常处理佳实践(上)MVC的单元测试简单学习总结AsMVC:一个简单的MVC框架的Java实现Asp.net Core MVC中使用Session一个简单的MVC框架的Java实现ASP.Net MVC 文件下载的几种方法ASP.Net MVC 文件下载的几种方法玩转Asp.net MVC 的八个扩展点SpringMVC配置中易犯的小错误Asp.net MVC连接MySQL数据库这算是ASP.NET MVC的一个大BUG吗?给Asp.Net MVC及WebApi添加路由优先级
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11热门文章
常见的移动App Bug??崩溃的测试用例设计如何用Jmeter做压力测试QC使用说明APP压力测试入门教程移动app测试中的主要问题jenkins+testng+ant+webdriver持续集成测试使用JMeter进行HTTP负载测试Selenium 2.0 WebDriver 使用指南