複製鏈接
請複製以下鏈接發送給好友

SHGetSpecialFolderPath

鎖定
SHGetSpecialFolderPath該api用來獲取指定的系統路徑。
外文名
SHGetSpecialFolderPath
用    途
獲取指定的系統路徑
hwndOwner
用API取一個窗口句柄或直傳null.
lpszPath
返回路徑的緩衝區
標識代號
nFolder
fCreate
true,false

目錄

  1. 1 簡介
  2. 2 VB6

SHGetSpecialFolderPath簡介

api用來獲取指定的系統路徑
API聲明: function ulong SHGetSpecialFolderPath(long hwndOwner,ref string lpszPath,int nFolder,boolean fCreate ) LIBRARY "shell32.dll" ALIAS FOR "SHGetSpecialFolderPathA"
Function Long GetDesktopWindow( ) Library 'user32.dll'
hwndOwner :可用GetDesktopWindow API取一個窗口句柄。或直接傳null.
lpszPath:返回路徑的緩衝區
nFolder:標識代號
fCreate:true :如果文件夾不存在則創建,false:不創建
lpszPath和nFolder對應關係:
nFolder
lpszPath
1
C:/Documents and Settings/當前用户/「開始」菜單/程序
2
C:/Documents and Settings/當前用户/My Documents
3
C:/Documents and Settings/當前用户/Favorites
4
C:/Documents and Settings/當前用户/「開始」菜單/程序/啓動
5
C:/Documents and Settings/當前用户/Recent
6
C:/Documents and Settings/當前用户/SendTo
7
C:/Documents and Settings/當前用户/「開始」菜單
8
C:/Documents and Settings/當前用户/桌面
9
C:/Documents and Settings/當前用户/NetHood
10
C:/WINDOWS/Fonts
11
C:/Documents and Settings/當前用户/Templates
12
C:/Documents and Settings/All Users/「開始」菜單
13
C:/Documents and Settings/All Users/「開始」菜單/程序
14
C:/Documents and Settings/All Users/「開始」菜單/程序/啓動
15
C:/Documents and Settings/All Users/桌面
16
C:/Documents and Settings/當前用户/Application Data
17
C:/Documents and Settings/當前用户/PrintHood
18
Settings/Application Data
19
C:/Documents and Settings/All Users/Favorites
20
Settings/Temporary Internet Files
21
C:/Documents and Settings/當前用户/Cookies
22
Settings/History
23
C:/Documents and Settings/All Users/Application Data
24
C:/WINDOWS
25
C:/WINDOWS/system32
26
C:/Program Files

SHGetSpecialFolderPathVB6

聲明(Declare
Declare Function SHGetSpecialFolderPath Lib "shell32.dll" Alias "SHGetSpecialFolderPathA" (ByVal hwnd As Long, ByVal pszPath As String, ByVal csidl As Long, ByVal fCreate As Long) As Long