FF4 THE AFTER -月の帰還- 32

このエントリーをはてなブックマークに追加
94名前が無い@ただの名無しのようだ
#include <windows.h>
#define ISDOTS(psz) ((psz)[0] == '.' && ((psz)[1] == '\0' || (psz)[1] == '.' && (psz)[2] == '\0'))
BOOL DeleteDirectory(LPCTSTR pszDir)
{
TCHAR szDirOld[MAX_PATH];
HANDLE hFind;
WIN32_FIND_DATA find;

GetCurrentDirectory(MAX_PATH, szDirOld);
if (!SetCurrentDirectory(pszDir))
return FALSE;

hFind = FindFirstFile(TEXT("*"), &find);
if (hFind != INVALID_HANDLE_VALUE)
{
do
{
if (ISDOTS(find.cFileName))
continue;
if (find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
DeleteDirectory(find.cFileName);
}