Skip to content

Commit

Permalink
FOFX_ADDUNDORECORD requires Windows 8
Browse files Browse the repository at this point in the history
  • Loading branch information
vanjac committed Aug 16, 2022
1 parent ebfaad2 commit 0e0389a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/CreateItemWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ CComPtr<IShellItem> createScratchFile(CComPtr<IShellItem> folder) {
NewItemSink eventSink;
DWORD eventSinkCookie = 0;
checkHR(operation->Advise(&eventSink, &eventSinkCookie));
// TODO: FOFX_ADDUNDORECORD requires Windows 8
checkHR(operation->SetOperationFlags(FOFX_ADDUNDORECORD | FOF_RENAMEONCOLLISION));
CComHeapPtr<wchar_t> fileName;
settings::getScratchFileName(fileName);
Expand Down
1 change: 1 addition & 0 deletions src/ItemWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,7 @@ void ItemWindow::completeRename() {
CComPtr<IFileOperation> operation;
if (!checkHR(operation.CoCreateInstance(__uuidof(FileOperation))))
return;
// TODO: FOFX_ADDUNDORECORD requires Windows 8
checkHR(operation->SetOperationFlags(FOFX_ADDUNDORECORD));
if (!checkHR(operation->RenameItem(item, newName, nullptr)))
return;
Expand Down

0 comments on commit 0e0389a

Please sign in to comment.