SHGetFolderPath   可以获取系统CSIDL路径

  •   C:\Documents and Settings\username\Application Data
  •   C:\Documents and Settings\All Users\Application Data. 
  •     
  •   C:\Program Files\Common
  •   C:\Windows\System32.
  •    C:\Windows.

 

TCHAR szPath[MAX_PATH];

if(SUCCEEDED(SHGetFolderPath(NULL, 
                             CSIDL_PERSONAL
|CSIDL_FLAG_CREATE, 
                             NULL, 
                             
0
                             szPath))) 
{
    PathAppend(szPath, TEXT(
"New Doc.txt"));
    HANDLE hFile 
= CreateFile(szPath, WindowsAPI 简介 SHGetFolderPath);
}

 具体内容 请查MSDN

 

 

相关文章:

  • 2021-06-29
  • 2021-12-01
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2021-10-09
  • 2021-09-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
  • 2022-01-10
  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案