From 53cbe1c2277a20bcc9b884462314714b99ee84b0 Mon Sep 17 00:00:00 2001 From: mere-human Date: Mon, 7 Mar 2022 22:38:04 +0200 Subject: [PATCH] Fix append extension when saving with Return (win 7) For some reason, the file name ComboBox isn't present when enumerating windows in OnFolderChange(). Because of that, we can't call onPreFileOk() in keyboard hook procedure. Fix that by retrying window search in OnSelectionChange() if we didn't find them previously. Fix #11305, fix #11355 --- .../src/WinControls/OpenSaveFileDialog/CustomFileDialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/CustomFileDialog.cpp b/PowerEditor/src/WinControls/OpenSaveFileDialog/CustomFileDialog.cpp index 0a48a9ba7..0d8adc7c9 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/CustomFileDialog.cpp +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/CustomFileDialog.cpp @@ -269,8 +269,10 @@ public: } IFACEMETHODIMP OnSelectionChange(IFileDialog*) override { - // This event isn't triggered in an empty folder. + // This event may not be triggered in an empty folder (Windows 10+). // Dialog startup calling order: 4. Main window is shown. + if (!foundControls()) + findControls(); return S_OK; } IFACEMETHODIMP OnShareViolation(IFileDialog*, IShellItem*, FDE_SHAREVIOLATION_RESPONSE*) override