BOOL IsDir(LPCSTR szDir) { DWORD dwAttrib; if ((dwAttrib = GetFileAttributes(szDir)) == 0xFFFFFFFF) return FALSE; return dwAttrib & FILE_ATTRIBUTE_DIRECTORY; }
ExampleUse() { if (IsDir("c:\\Documents and Settings")) { printf("You have a D&S folder\n"); } else { printf("You do NOT have a D&S folder\n"); } }