From c376fcda950b1f920fdd962842d6589acc3e61e5 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 18:35:58 +0100 Subject: [PATCH] Type the file name after the shell initializes its suggested destination --- .github/qa-windows-saves.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/qa-windows-saves.py b/.github/qa-windows-saves.py index 2425d0a40a..6b3aca1f57 100644 --- a/.github/qa-windows-saves.py +++ b/.github/qa-windows-saves.py @@ -102,8 +102,17 @@ try: field=next((c for c in edits if c[2]==1001),edits[0] if len(edits)==1 else None) button=next((c for c in children if c[1]=="Button" and c[2]==1),None) assert field and button, (edits,button) - name=ctypes.create_unicode_buffer(str(filename)) - assert user.SendMessageW(field[0],12,0,ctypes.addressof(name)) + def entered_name(): + value=ctypes.create_unicode_buffer(1000) + user.SendMessageW(field[0],13,len(value),ctypes.addressof(value)) + return value.value + wait(entered_name,"Shell did not initialize the suggested file name") + print("Suggested",entered_name(),flush=True) + user.SendMessageW(field[0],177,0,-1) # EM_SETSEL + for char in str(filename): + user.SendMessageW(field[0],258,ord(char),1) # WM_CHAR notifies the shell of the edit. + assert entered_name()==str(filename), entered_name() + time.sleep(.4) assert user.PostMessageW(button[0],245,0,0) time.sleep(.8) def saved():