SHGetSpecialFolderPath用法
The SHGetSpecialFolderPath function retrieves the path of a special folder that is identified by its CSIDL.
Syntax
BOOL SHGetSpecialFolderPath(
HWND hwndOwner,
LPTSTR lpszPath,
int nFolder,
BOOL fCreate
);
Parameters
- hwndOwner
- [in] Handle to the owner window the client should specify if it displays a dialog box or message box.
- lpszPath
- [in] Reference to a character buffer that receives the drive and path of the specified folder. This buffer must be at least MAX_PATH characters in size.
- nFolder
- [in] CSIDL that identifies the folder of interest. If a virtual folder is specified, this function fails. See Remarks for possible values.
- fCreate
- [in] Indicates whether the folder should be created if it does not already exist. If this value is nonzero, the folder is created. If this value is zero, the folder is not created.
Return Values
For Windows Mobile 2003 and later, returns TRUE if successful, FALSE otherwise. For Windows Mobile 2002 and earlier, returns FALSE even if successful. If the folder represented by the nFolder parameter does not exist and is not created, a NULL string is returned indicating that the directory does not exist.
Remarks
A number of folders are used frequently by applications but might not have the same name or location on any given system. CSIDL values provide a system-independent way to identify these special folders. These values supersede the use of environment variables for this purpose.
The following table lists valid CSIDL values for the nFolder parameter:
| CSIDL | Value | Description |
|---|---|---|
| CSIDL_DESKTOP | 0x0000 | Not supported on Smartphone. |
| CSIDL_FAVORITES | 0x0006 | The file system directory that serves as a common repository for the user's favorite items. |
| CSIDL_FONTS | 0x0014 | The virtual folder that contains fonts. |
| CSIDL_PERSONAL | 0x0005 | The file system directory that serves as a common repository for documents. |
| CSIDL_PROGRAM_FILES | 0x0026 | The program files folder. |
| CSIDL_PROGRAMS | 0x0002 | The file system directory that contains the user's program groups, which are also file system directories. |
| CSIDL_STARTUP | 0x0007 | The file system directory that corresponds to the user's Startup program group. The system starts these programs when a device is powered on. |
| CSIDL_WINDOWS | 0x0024 | The Windows folder. |
The CSIDL_DESKTOP value is invalid for the Smartphone platform. Smartphone uses a home screen instead of a desktop; do not use this CSIDL value within the Smartphone development environment.
进行 Shell 程序的设计,需要使用一些头文件和库文件。
一般 Shell API 都在 shlobj.h 头文件中声明,由 Shell32.dll 导出,链接时需要使用到 Shell32.lib 库。
|
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
/*************************************
* VOID GetSpecialFolderQS() * 功能 SHGetSpecialFolderPath用法 * * 参数 未使用 **************************************/ VOID GetSpecialFolderQS() { CHAR szDeskTop[MAX_PATH] = {}; CHAR szFavourites[MAX_PATH] = {}; CHAR szFonts[MAX_PATH] = {}; CHAR szMyDocument[MAX_PATH] = {}; CHAR szProgramFiles[MAX_PATH] = {}; CHAR szPrograms[MAX_PATH] = {}; CHAR szStartUp[MAX_PATH] = {}; CHAR szWindows[MAX_PATH] = {}; // 使用SHGetSpecialFolderPath获取特殊目录路径 |

SHGetSpecialFolderPath用法的更多相关文章
- EditText 基本用法
title: EditText 基本用法 tags: EditText,编辑框,输入框 --- EditText介绍: EditText 在开发中也是经常用到的控件,也是一个比较必要的组件,可以说它是 ...
- jquery插件的用法之cookie 插件
一.使用cookie 插件 插件官方网站下载地址:http://plugins.jquery.com/cookie/ cookie 插件的用法比较简单,直接粘贴下面代码示例: //生成一个cookie ...
- Java中的Socket的用法
Java中的Socket的用法 Java中的Socket分为普通的Socket和NioSocket. 普通Socket的用法 Java中的 ...
- [转载]C#中MessageBox.Show用法以及VB.NET中MsgBox用法
一.C#中MessageBox.Show用法 MessageBox.Show (String) 显示具有指定文本的消息框. 由 .NET Compact Framework 支持. MessageBo ...
- python enumerate 用法
A new built-in function, enumerate() , will make certain loops a bit clearer. enumerate(thing) , whe ...
- [转载]Jquery中$.get(),$.post(),$.ajax(),$.getJSON()的用法总结
本文对Jquery中$.get(),$.post(),$.ajax(),$.getJSON()的用法进行了详细的总结,需要的朋友可以参考下,希望对大家有所帮助. 详细解读Jquery各Ajax函数: ...
- 【JavaScript】innerHTML、innerText和outerHTML的用法区别
用法: <div id="test"> <span style="color:red">test1</span> tes ...
- chattr用法
[root@localhost tmp]# umask 0022 一.chattr用法 1.创建空文件attrtest,然后删除,提示无法删除,因为有隐藏文件 [root@localhost tmp] ...
- 萌新笔记——vim命令“=”、“d”、“y”的用法(结合光标移动命令,一些场合会非常方便)
vim有许多命令,网上搜有一堆贴子.文章列举出各种功能的命令. 对于"="."d"."y",我在无意中发现了它们所具有的相同的一些用法,先举 ...
随机推荐
- Android设计模式系列(1)--SDK源码之组合模式
Android中对组合模式的应用,可谓是泛滥成粥,随处可见,那就是View和ViewGroup类的使用.在android UI设计,几乎所有的widget和布局类都依靠这两个类.组合模式,Compos ...
- Intellij IDEA 使用技巧一
前言 个人之前一直用eclipse做c++.java开发,换到新公司,大家都用IDEA开发工具,所以最近也在学习,总结下个人心得. 1.文本编辑 删除 ctr + y 复制 ...
- jquery 属性操作 attr( ) prop()css( )区别
一 attr () 和 prop( ) 操作属性 谈谈我的总结: 1 2 1 属性的定义,根据W3C手册所述:属性包括,标准属性:id class style title 语言属性 lang dir以 ...
- 《开源框架那点事儿23》:採用TinyDB组件方式开发
採用TinyDB组件方式开发 步骤 Icon 前文介绍四则运算的流程编程开发时,说过流程编排在开发反复功能时.能够利用已有的组件库高速开发.对于开发者而言仅仅须要简单配置流程就能够完毕工作了.开发增删 ...
- Python 实现小数和百分数的相互转换
# -*- coding: utf-8 -*- #百分比转换位小数 # -*- coding: utf-8 -*- s = '20%' # 默认要转换的百分比是字符串aa = float(s.stri ...
- win10 配置 python3 + opencv3.2 + VideoCapture
最近需要在 win10 上进行图片处理,使用深度学习框架 tensorflow ,所以安装了python3.5 + opencv3.2 + tensorflow + VideoCapture + PI ...
- mysql的show操作
SHOW CHARACTER SET 显示所有可用的字符集 SHOW CHARACTER SET; SHOW CHARACTER SET LIKE 'latin%'; SHOW COLLATION 输 ...
- 细说websocket - php篇(未完)
下面我画了一个图演示 client 和 server 之间建立 websocket 连接时握手部分,这个部分在 node 中可以十分轻松的完成,因为 node 提供的 net 模块已经对 socket ...
- 源码分析HotSpot GC过程(二):DefNewGeneration的GC过程
由于虚拟机的分代实现,虚拟机不会考虑各个内存代如何实现垃圾回收,具体的工作(对象内存的分配也是一样)由各内存代根据垃圾回收策略自行实现. DefNewGeneration的使用复制算法进行回收.复制算 ...
- MySQL 5.7.16 zip包配置
截止2016/10/16 最新版本Mysql为5.7.16,之前写过一篇APMW搭建的文章(传送门:http://www.cnblogs.com/airoot/p/4131906.html)里面介绍的 ...