SHGetSpecialFolderPath

SHGetSpecialFolderPath該api用來獲取指定的系統路徑

基本介紹

  • 外文名:SHGetSpecialFolderPath
  • 用途:獲取指定的系統路徑
  • hwndOwner:用API取一個視窗句柄或直傳null.
  • lpszPath:返迴路徑的緩衝區
  • 標識代號:nFolder
  • fCreate:true,false
簡介,VB6,

簡介

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

VB6

聲明(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

相關詞條

熱門詞條

聯絡我們