炫彩界面库为你解答: 用这个API获取程序的路径,
DWORD WINAPI GetModuleFileName( __in HMODULE hModule, __out LPTSTR lpFilename, __in DWORD nSize);
然后用这个函数, 有兴趣可以加入我们的编程群; 获取文件的属性, 返回值就是属性类型, 不懂可以看MSDN;
DWORD WINAPI GetFileAttributes( __in LPCTSTR lpFileName);
If the function succeeds, the return value contains the attributes of the
specified file or directory. 如果函数成功,返回值是指定文件的属性, 炫彩欢迎您, 或目录的属性
If the function fails, the return value is INVALID_FILE_ATTRIBUTES. To get
extended error information, call GetLastError. 失败了当然是返回 个无效的宏定义INVALID_FILE_ATTRIBUTES 这个是定义在代码中的.
The attributes can be one or more of the following values. 更多的那就自己看MSDN了;
这里就不写了;