SHGetSpecialFolderPath()

SHGetSpecialFolderPath()

 

Minimum DLL Version shell32.dll version 4.71 or later
Custom Implementation No
Header shlobj.h
Import library shell32.lib
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0
Unicode Implemented as ANSI and Unicode versions.
 

 BOOL SHGetSpecialFolderPath(      
    HWND hwndOwner,                 //NULL
    LPTSTR lpszPath,                  //버퍼
    int csidl,                               //TRUE : 폴더경로를 만든다.   ,  FALSE : 폴더를 만들지 않는다.    is FALSE
    BOOL fCreate
);

 

ex)
 TCAHR szSpecialPath[MAX_PATH] = { 0 };
 SHGetSpecailPath( NULL, szSpecailPath, CSIDL_PROGRAMS, FALSE );
 :시작메뉴-프로그램 폴더 경로를 가져온다.

 

csidl 값에

 "CSIDL_DESKTOP                 {desktop}"
 "CSIDL_INTERNET                Internet Explorer (icon on desktop)"
 "CSIDL_PROGRAMS                Start Menu\Programs"
 "CSIDL_CONTROLS                My Computer\Control Panel"
 "CSIDL_PRINTERS                My Computer\Printers"
 "CSIDL_PERSONAL                My Documents"
 "CSIDL_FAVORITES               {user name}\Favorites"
 "CSIDL_STARTUP                 Start Menu\Programs\Startup"
 "CSIDL_RECENT                  {user name}\Recent"
 "CSIDL_SENDTO                  {user name}\SendTo"
 "CSIDL_BITBUCKET               {desktop}\Recycle Bin"
 "CSIDL_STARTMENU               {user name}\Start Menu"
 "CSIDL_DESKTOPDIRECTORY        {user name}\Desktop"
 "CSIDL_DRIVES                  My Computer"
 "CSIDL_NETWORK                 Network Neighborhood"
 "CSIDL_NETHOOD                 {user name}\nethood"
 "CSIDL_FONTS                   windows\fonts"
 "CSIDL_TEMPLATES"
 "CSIDL_COMMON_STARTMENU         All Users\Start Menu"
 "CSIDL_COMMON_PROGRAMS          All Users\Programs"
 "CSIDL_COMMON_STARTUP           All Users\Startup"
 "CSIDL_COMMON_DESKTOPDIRECTORY  All Users\Desktop"
 "CSIDL_APPDATA                  {user name}\Application Data"
 "CSIDL_PRINTHOOD                {user name}\PrintHood"
 "CSIDL_LOCAL_APPDATA            {user name}\Local Settings\Application Data (non roaming)"
 "CSIDL_ALTSTARTUP               non localized startup"
 "CSIDL_COMMON_ALTSTARTUP        non localized common startup"
 "CSIDL_COMMON_FAVORITES"
 "CSIDL_INTERNET_CACHE"
 "CSIDL_COOKIES"
 "CSIDL_HISTORY"
 "CSIDL_COMMON_APPDATA           All Users\Application Data"
 "CSIDL_WINDOWS                  GetWindowsDirectory()"
 "CSIDL_SYSTEM                   GetSystemDirectory()"
 "CSIDL_PROGRAM_FILES            C:\Program Files"
 "CSIDL_MYPICTURES               C:\Program Files\My Pictures"
 "CSIDL_PROFILE                  USERPROFILE"
 "CSIDL_SYSTEMX86                x86 system directory on RISC"
 "CSIDL_PROGRAM_FILESX86         x86 C:\Program Files on RISC"
 "CSIDL_PROGRAM_FILES_COMMON     C:\Program Files\Common"
 "CSIDL_PROGRAM_FILES_COMMONX86  x86 Program Files\Common on RISC"
 "CSIDL_COMMON_TEMPLATES         All Users\Templates"
 "CSIDL_COMMON_DOCUMENTS         All Users\Documents"
 "CSIDL_COMMON_ADMINTOOLS        All Users\Start Menu\Programs\Administrative Tools"
 "CSIDL_ADMINTOOLS               {user name}\Start Menu\Programs\Administrative Tools" 

위로 스크롤