http://www.nirsoft.net/utils/special_folders_view.html 그냥 참고.
바탕 화면의 문자열
CString GetDesktopLabel ( int *sysIconIndex )
{
TCHAR path [ MAX_PATH ] = "" ;
LPMALLOC pMalloc ;
SHGetMalloc ( &pMalloc ) ;
SHFILEINFO sfi = { 0 , } ;
// 'Desktop' or '바탕 화면' text
LPITEMIDLIST pidl ;
SHGetSpecialFolderLocation ( nullptr , CSIDL_DESKTOP , &pidl ) ;
SHGetFileInfo ( (char*) pidl , 0 , &sfi , sizeof ( sfi ) , SHGFI_DISPLAYNAME | SHGFI_SYSICONINDEX | SHGFI_PIDL ) ;
pMalloc->Free ( pidl ) ;
pMalloc->Release ( ) ;
if ( sysIconIndex != nullptr )
{
*sysIconIndex = sfi.iIcon ;
}
return sfi.szDisplayName ;
}
바탕 화면 실제 경로
TCHAR desktop_path [ MAX_PATH ] = "" ;
SHGetSpecialFolderPath ( nullptr , desktop_path , CSIDL_DESKTOPDIRECTORY , 0 ) ;
내 문서 문자열
CString GetMyDocumentLabel ( int *sysIconIndex )
{
LPMALLOC pMalloc ;
SHGetMalloc ( &pMalloc ) ;
SHFILEINFO sfi = { 0 , } ;
// 'My Document' or '내 문서' text
LPITEMIDLIST pidl ;
SHGetSpecialFolderLocation ( nullptr , CSIDL_PERSONAL , &pidl ) ;
SHGetFileInfo ( (char*) pidl , 0 , &sfi , sizeof ( sfi ) , SHGFI_DISPLAYNAME | SHGFI_SYSICONINDEX | SHGFI_PIDL ) ;
pMalloc->Free ( pidl ) ;
pMalloc->Release ( ) ;
if ( sysIconIndex != nullptr )
{
*sysIconIndex = sfi.iIcon ;
}
return sfi.szDisplayName ;
}
내 문서 실제 경로
TCHAR path [ MAX_PATH ] = "" ;
SHGetSpecialFolderPath ( nullptr , path , CSIDL_PERSONAL , 0 ) ;
내 컴퓨터의 문자열
'Technical Report' 카테고리의 다른 글
Win32 C++: How do I change the window icon during runtime? (0) | 2014.01.20 |
---|---|
코드 최적화 (0) | 2014.01.06 |
CAtlList // while 에서 RemoveAt 사용 주의 (0) | 2013.04.17 |
레지스트리 설정 [ 표준 101 키보드 & 한글103/106 키보드 ] (0) | 2013.02.13 |
일.시.분.초 (0) | 2012.05.25 |