Coupple regressions fixed.
This commit is contained in:
1 parent
39b7488aea
commit
9aad6748e0
7 files changed
+54
-5
No files matched your search
@@ -4,6 +4,20 @@
|
||||
|
||||
static DWORD notepad_pid;
|
||||
static HWND notepad;
|
||||
static HWND saveDialog;
|
||||
|
||||
static BOOL CALLBACK find_save_dialog(HWND window, LPARAM unused) {
|
||||
(void)unused;
|
||||
DWORD pid;
|
||||
GetWindowThreadProcessId(window, &pid);
|
||||
if (pid == notepad_pid && IsWindowVisible(window) &&
|
||||
GetDlgItem(window, IDYES) && GetDlgItem(window, IDNO) &&
|
||||
GetDlgItem(window, IDCANCEL)) {
|
||||
saveDialog = window;
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL CALLBACK find_notepad(HWND window, LPARAM unused) {
|
||||
(void)unused;
|
||||
@@ -65,6 +79,20 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE previous, LPSTR args, int show)
|
||||
WCHAR text[80] = {0};
|
||||
SendMessageW(edit, WM_GETTEXT, 80, (LPARAM)text);
|
||||
if (!lstrcmpW(text, L"hello beta\r\notepad second line")) result = 0;
|
||||
PostMessageW(notepad, WM_CLOSE, 0, 0);
|
||||
for (int i = 0; i < 100 && !saveDialog; ++i) {
|
||||
EnumWindows(find_save_dialog, 0);
|
||||
Sleep(50);
|
||||
}
|
||||
if (!saveDialog) result = 2;
|
||||
else {
|
||||
SetForegroundWindow(saveDialog);
|
||||
Sleep(400);
|
||||
key(VK_TAB, FALSE, FALSE); // Yes -> No
|
||||
key(VK_TAB, FALSE, FALSE); // No -> Cancel
|
||||
key(VK_TAB, FALSE, TRUE); // Cancel -> No
|
||||
key(VK_ESCAPE, FALSE, FALSE);
|
||||
}
|
||||
// Suppress the save prompt only in this test-owned, unsaved document.
|
||||
SendMessageW(edit, EM_SETMODIFY, FALSE, 0);
|
||||
PostMessageW(notepad, WM_CLOSE, 0, 0);
|
||||
|
||||
Reference in new issue
Block a user