Skip to content

Instantly share code, notes, and snippets.

@lookat23
Created October 18, 2014 02:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lookat23/5f6cc588c6b41e9e10d4 to your computer and use it in GitHub Desktop.
Save lookat23/5f6cc588c6b41e9e10d4 to your computer and use it in GitHub Desktop.
win32 获得系统各种路径
#include
main()
{
char MyDir[MAX_PATH];
SHGetSpecialFolderPath(NULL,MyDir,CSIDL_APPDATA,0); // CSIDL_APPDATA 获取的是 APPDATA的路径,其它路径可以去看MSDN
// 微软推荐用这个API SHGetKnownFolderPath ,但这个API不能向下兼容,到xp就用不了
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment