SHFileOperation API (RemoveDirectory API 대체 사용)
저장소/VC++RemoveDirectory API의 경우 폴더에 하위 구성이 존재할 경우 실패 발생.
SHFileOperation API 사용으로 이를 해결 가능.
SHFileOperation
http://msdn.microsoft.com/en-us/library/windows/desktop/bb762164(v=vs.85).aspx
int SHFileOperation( _Inout_ LPSHFILEOPSTRUCT lpFileOp
);
SHFILEOPSTRUCT structure
http://msdn.microsoft.com/en-us/library/windows/desktop/bb759795(v=vs.85).aspx
typedef struct _SHFILEOPSTRUCT { HWND hwnd; UINT wFunc; PCZZTSTR pFrom; // This string must be double-null terminated.
PCZZTSTR pTo; // This string must be double-null terminated.
FILEOP_FLAGS fFlags; BOOL fAnyOperationsAborted; LPVOID hNameMappings; PCTSTR lpszProgressTitle;
} SHFILEOPSTRUCT, *LPSHFILEOPSTRUCT;
※ 주의
pFrom, pTo 문자열은 반드시 double-null terminated 이어야 한다.
Although this member is declared as a single null-terminated string, it is actually a buffer that can hold multiple null-delimited file names. Each file name is terminated by a single NULL character. The last file name is terminated with a double NULL character ("\0\0") to indicate the end of the buffer.
'저장소 > VC++' 카테고리의 다른 글
strftime format 좀 기억하자! (0) | 2014.08.08 |
---|---|
SQLite - Syntax (0) | 2014.05.27 |
SQLite - insert or replace (upsert) (0) | 2014.04.29 |
윈도우 재배치 깜빡임 줄이기 - DeferWindowPos (0) | 2013.11.19 |
How to use VC_EXTRALEAN and WIN32_LEAN_AND_MEAN to enhance the build process in Visual C++ (0) | 2013.11.19 |