win32 shell 파일 복원 로직.
윈도우 shellapi.h 에서 지운 파일을 복원하는 API가 없습니다. 구현방법은 다음과 같습니다. 윈도우 휴지통의 모든 파일을 검색해 최근 삭제한 파일, 폴더를 복원합니다. #include <windows.h> #include <shlobj.h> #include <shlwapi.h> #include <propkey.h> #include <propvarutil.h> #include <iostream> #include <string> #include <wrl/client.h> #pragma comment ( lib , "shell32.lib" ) #pragma comment ( lib , "ole32.lib" ) #pragma comment ( lib , "propsys.lib" ) static HRESULT GetFileTimeProp ( IShellItem2 * item2 , const PROPERTYKEY & key , FILETIME & outFt ) { outFt = {}; PROPVARIANT pv; PropVariantInit ( & pv); HRESULT hr = item2 -> GetProperty (key, & pv); if ( FAILED (hr)) { PropVariantClear ( & pv); return hr; } if ( pv . vt == VT_FILETIME) { outFt = pv . filetime ; PropVariantClear ( & pv); return S_OK; } if ( pv . vt == VT_DATE) { ...