mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Updated user32-msgbox-Support-WM_COPY-mesg patchset
Sync to latest PR
This commit is contained in:
parent
9a4fd0b9b0
commit
680ab2f323
@ -1,18 +1,19 @@
|
||||
From f05f0efcd0cec49f3ad4faa2cc3bd21c7da75c44 Mon Sep 17 00:00:00 2001
|
||||
From 8b0b5c98427224a7da7d4fe380bb8568aa43808c Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 7 Apr 2016 16:04:36 +1000
|
||||
Subject: [PATCH] user32/msgbox: Support WM_COPY Message
|
||||
Date: Wed, 6 Mar 2024 20:21:36 +1100
|
||||
Subject: [PATCH 1/2] user32/msgbox: Support WM_COPY Message
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=17205
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
dlls/user32/msgbox.c | 86 +++++++++++++++++-
|
||||
dlls/user32/tests/dialog.c | 182 +++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 263 insertions(+), 5 deletions(-)
|
||||
dlls/user32/msgbox.c | 85 ++++++++++++++++-
|
||||
dlls/user32/tests/dialog.c | 166 ++++++++++++++++++++++++++++++++++
|
||||
dlls/user32/tests/resource.rc | 11 +++
|
||||
3 files changed, 257 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/user32/msgbox.c b/dlls/user32/msgbox.c
|
||||
index 4d345777a10..1136374deb1 100644
|
||||
index 4d345777a10..6b5d867eb1f 100644
|
||||
--- a/dlls/user32/msgbox.c
|
||||
+++ b/dlls/user32/msgbox.c
|
||||
@@ -41,6 +41,11 @@ struct ThreadWindows
|
||||
@ -39,17 +40,16 @@ index 4d345777a10..1136374deb1 100644
|
||||
nclm.cbSize = sizeof(nclm);
|
||||
SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
|
||||
|
||||
@@ -320,6 +320,77 @@ static void MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
|
||||
@@ -320,6 +320,76 @@ static void MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
|
||||
HeapFree( GetProcessHeap(), 0, buffer );
|
||||
}
|
||||
|
||||
+static void MSGBOX_CopyToClipbaord( HWND hwnd )
|
||||
+{
|
||||
+ int i;
|
||||
+ static const WCHAR line[] = {'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-',
|
||||
+ '-','-','-','-','-','-','-','-','\r','\n', 0};
|
||||
+ static const WCHAR carriage[] = {'\r','\n', 0};
|
||||
+ static const WCHAR spaces[] = {' ',' ',' ', 0};
|
||||
+ static const WCHAR line[] = L"---------------------------\r\n";
|
||||
+ static const WCHAR carriage[] = L"\r\n";
|
||||
+ static const WCHAR spaces[] = L" ";
|
||||
+ int lenTitle = GetWindowTextLengthW(hwnd) + 1;
|
||||
+ int lenMsg = GetWindowTextLengthW(GetDlgItem(hwnd, MSGBOX_IDTEXT)) + 1;
|
||||
+
|
||||
@ -62,7 +62,7 @@ index 4d345777a10..1136374deb1 100644
|
||||
+ Button(s) Text. OK
|
||||
+ ---------------------------
|
||||
+ */
|
||||
+ int len = ((sizeof(carriage) * 3) + (sizeof(line) * 4) + lenTitle + lenMsg) * sizeof(WCHAR);
|
||||
+ int len = ((wcslen(carriage) * 3) + (wcslen(line) * 4) + lenTitle + lenMsg) * sizeof(WCHAR);
|
||||
+ WCHAR *text = heap_alloc(len);
|
||||
+ if(text)
|
||||
+ {
|
||||
@ -117,7 +117,7 @@ index 4d345777a10..1136374deb1 100644
|
||||
|
||||
/**************************************************************************
|
||||
* MSGBOX_DlgProc
|
||||
@@ -338,6 +409,11 @@ static INT_PTR CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,
|
||||
@@ -338,6 +408,11 @@ static INT_PTR CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,
|
||||
SetPropA(hwnd, "WINE_MSGBOX_HELPCALLBACK", mbp->lpfnMsgBoxCallback);
|
||||
break;
|
||||
}
|
||||
@ -130,101 +130,14 @@ index 4d345777a10..1136374deb1 100644
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam))
|
||||
diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c
|
||||
index 7ea0d13c0f3..448b69ca2a3 100644
|
||||
index 7ea0d13c0f3..41572b29ecc 100644
|
||||
--- a/dlls/user32/tests/dialog.c
|
||||
+++ b/dlls/user32/tests/dialog.c
|
||||
@@ -2068,6 +2068,187 @@ static void test_MessageBoxFontTest(void)
|
||||
@@ -2068,6 +2068,171 @@ static void test_MessageBoxFontTest(void)
|
||||
DestroyWindow(hDlg);
|
||||
}
|
||||
|
||||
+static const char msgbox_title[] = "%5!z9ZXw*ia;57n/FGl.bCH,Su\"mfKN;foCqAU\'j6AmoJgAc_D:Z0A\'E6PF_O/w";
|
||||
+static WCHAR expectedOK[] =
|
||||
+{
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'%','5','!','z','9','Z','X','w','*','i','a',';','5','7','n','/','F','G','l','.','b','C','H',',','S','u','"','m','f',
|
||||
+'K','N',';','f','o','C','q','A','U','\'','j','6','A','m','o','J','g','A','c','_','D',':','Z','0','A','\'','E','6','P',
|
||||
+'F','_','O','/','w','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'M','e','s','s','a','g','e','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'O','K',' ',' ',' ','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n', 0
|
||||
+};
|
||||
+static WCHAR expectedOkCancel[] =
|
||||
+{
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'%','5','!','z','9','Z','X','w','*','i','a',';','5','7','n','/','F','G','l','.','b','C','H',',','S','u','"','m','f',
|
||||
+'K','N',';','f','o','C','q','A','U','\'','j','6','A','m','o','J','g','A','c','_','D',':','Z','0','A','\'','E','6','P',
|
||||
+'F','_','O','/','w','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'M','e','s','s','a','g','e','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'O','K',' ',' ',' ','C','a','n','c','e','l',' ',' ',' ','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n', 0
|
||||
+};
|
||||
+static WCHAR expectedAbortRetryIgnore[] =
|
||||
+{
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'%','5','!','z','9','Z','X','w','*','i','a',';','5','7','n','/','F','G','l','.','b','C','H',',','S','u','"','m','f',
|
||||
+'K','N',';','f','o','C','q','A','U','\'','j','6','A','m','o','J','g','A','c','_','D',':','Z','0','A','\'','E','6','P',
|
||||
+'F','_','O','/','w','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'M','e','s','s','a','g','e','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'A','b','o','r','t',' ',' ',' ','R','e','t','r','y',' ',' ',' ','I','g','n','o','r','e',' ',' ',' ','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n', 0
|
||||
+};
|
||||
+
|
||||
+static WCHAR expectedYesNo[] =
|
||||
+{
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'%','5','!','z','9','Z','X','w','*','i','a',';','5','7','n','/','F','G','l','.','b','C','H',',','S','u','"','m','f',
|
||||
+'K','N',';','f','o','C','q','A','U','\'','j','6','A','m','o','J','g','A','c','_','D',':','Z','0','A','\'','E','6','P',
|
||||
+'F','_','O','/','w','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'M','e','s','s','a','g','e','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'Y','e','s',' ',' ',' ','N','o',' ',' ',' ','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n', 0
|
||||
+};
|
||||
+static WCHAR expectedYesNoCancel[] =
|
||||
+{
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'%','5','!','z','9','Z','X','w','*','i','a',';','5','7','n','/','F','G','l','.','b','C','H',',','S','u','"','m','f',
|
||||
+'K','N',';','f','o','C','q','A','U','\'','j','6','A','m','o','J','g','A','c','_','D',':','Z','0','A','\'','E','6','P',
|
||||
+'F','_','O','/','w','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'M','e','s','s','a','g','e','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'Y','e','s',' ',' ',' ','N','o',' ',' ',' ','C','a','n','c','e','l',' ',' ',' ','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n', 0
|
||||
+};
|
||||
+static WCHAR expectedRetryCancel[] =
|
||||
+{
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'%','5','!','z','9','Z','X','w','*','i','a',';','5','7','n','/','F','G','l','.','b','C','H',',','S','u','"','m','f',
|
||||
+'K','N',';','f','o','C','q','A','U','\'','j','6','A','m','o','J','g','A','c','_','D',':','Z','0','A','\'','E','6','P',
|
||||
+'F','_','O','/','w','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'M','e','s','s','a','g','e','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'R','e','t','r','y',' ',' ',' ','C','a','n','c','e','l',' ',' ',' ','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n', 0
|
||||
+};
|
||||
+static WCHAR expectedCancelTryContinue[] =
|
||||
+{
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'%','5','!','z','9','Z','X','w','*','i','a',';','5','7','n','/','F','G','l','.','b','C','H',',','S','u','"','m','f',
|
||||
+'K','N',';','f','o','C','q','A','U','\'','j','6','A','m','o','J','g','A','c','_','D',':','Z','0','A','\'','E','6','P',
|
||||
+'F','_','O','/','w','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'M','e','s','s','a','g','e','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n',
|
||||
+'C','a','n','c','e','l',' ',' ',' ','T','r','y',' ','A','g','a','i','n',' ',' ',' ','C','o','n','t','i','n','u','e',' ',' ',' ','\r','\n',
|
||||
+'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\r','\n', 0
|
||||
+};
|
||||
+
|
||||
+BOOL non_english = FALSE;
|
||||
+
|
||||
+DWORD WINAPI WorkerThread(void *param)
|
||||
+{
|
||||
@ -243,7 +156,6 @@ index 7ea0d13c0f3..448b69ca2a3 100644
|
||||
+ lstrcmpA(msgbox_title, windowTitle) == 0))
|
||||
+ {
|
||||
+ hwndMbox = FindWindowA(NULL, msgbox_title);
|
||||
+
|
||||
+ if (!IsWindow(hwndMbox))
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
@ -257,16 +169,11 @@ index 7ea0d13c0f3..448b69ca2a3 100644
|
||||
+
|
||||
+ if (text != NULL)
|
||||
+ {
|
||||
+ if(non_english)
|
||||
+ ok(lstrlenW(text) > 0, "Empty string on clipboard\n");
|
||||
+ else
|
||||
+ succeeded = lstrcmpW(expected, text) == 0;
|
||||
+ if(!succeeded)
|
||||
+ {
|
||||
+ succeeded = lstrcmpW(expected, text) == 0;
|
||||
+ if(!succeeded)
|
||||
+ {
|
||||
+ ok(0, "%s\n", wine_dbgstr_w(text));
|
||||
+ ok(0, "%s\n", wine_dbgstr_w(expected));
|
||||
+ }
|
||||
+ ok(0, "%s\n", wine_dbgstr_w(text));
|
||||
+ ok(0, "%s\n", wine_dbgstr_w(expected));
|
||||
+ }
|
||||
+
|
||||
+ GlobalUnlock(textHandle);
|
||||
@ -284,49 +191,150 @@ index 7ea0d13c0f3..448b69ca2a3 100644
|
||||
+ PostMessageA(hwndMbox, WM_CLOSE, 0, 0);
|
||||
+
|
||||
+cleanup:
|
||||
+ ok(succeeded || non_english, "Failed to get string.\n");
|
||||
+ ok(succeeded, "Failed to get string.\n");
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static WCHAR *shell_get_resource_string(UINT id)
|
||||
+{
|
||||
+ const WCHAR *resource;
|
||||
+ unsigned int size;
|
||||
+ WCHAR *ret;
|
||||
+
|
||||
+ size = LoadStringW(NULL, id, (WCHAR *)&resource, 0);
|
||||
+ ret = malloc((size + 1) * sizeof(WCHAR));
|
||||
+ memcpy(ret, resource, size * sizeof(WCHAR));
|
||||
+ ret[size] = 0;
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static WCHAR *create_msgbox_message(UINT res1, UINT res2, UINT res3)
|
||||
+{
|
||||
+ /*
|
||||
+ ---------------------------
|
||||
+ Dialog Title
|
||||
+ ---------------------------
|
||||
+ Dialog Message
|
||||
+ ---------------------------
|
||||
+ Button(s) Text. OK<+3 spaces>
|
||||
+ ---------------------------
|
||||
+ */
|
||||
+ static WCHAR text[512];
|
||||
+ WCHAR *btn1text = shell_get_resource_string(res1);
|
||||
+
|
||||
+ lstrcpyW(text, L"---------------------------\r\n");
|
||||
+ lstrcatW(text, L"%5!z9ZXw*ia;57n/FGl.bCH,Su\"mfKN;foCqAU\'j6AmoJgAc_D:Z0A\'E6PF_O/w");
|
||||
+ lstrcatW(text, L"\r\n");
|
||||
+ lstrcatW(text, L"---------------------------\r\n");
|
||||
+ lstrcatW(text, L"Message\r\n");
|
||||
+ lstrcatW(text, L"---------------------------\r\n");
|
||||
+
|
||||
+ lstrcatW(text, btn1text);
|
||||
+ lstrcatW(text, L" ");
|
||||
+ free(btn1text);
|
||||
+
|
||||
+ if (res2 != 0)
|
||||
+ {
|
||||
+ WCHAR *btn2text = shell_get_resource_string(res2);
|
||||
+ lstrcatW(text, btn2text);
|
||||
+ lstrcatW(text, L" ");
|
||||
+ free(btn2text);
|
||||
+ }
|
||||
+ if (res3 != 0)
|
||||
+ {
|
||||
+ WCHAR *btn3text = shell_get_resource_string(res3);
|
||||
+ lstrcatW(text, btn3text);
|
||||
+ lstrcatW(text, L" ");
|
||||
+ free(btn3text);
|
||||
+ }
|
||||
+ lstrcatW(text, L"\r\n---------------------------\r\n");
|
||||
+
|
||||
+ return text;
|
||||
+}
|
||||
+
|
||||
+static void test_MessageBox_WM_COPY_Test(void)
|
||||
+{
|
||||
+ DWORD tid = 0;
|
||||
+ WCHAR *expected;
|
||||
+ HANDLE hthread;
|
||||
+
|
||||
+ non_english = (PRIMARYLANGID(GetUserDefaultLangID()) != LANG_ENGLISH);
|
||||
+ trace("non_english %d\n", non_english);
|
||||
+
|
||||
+ CreateThread(NULL, 0, WorkerThread, &expectedOK, 0, &tid);
|
||||
+ expected = create_msgbox_message(102 /* OK */, 0, 0);
|
||||
+ hthread = CreateThread(NULL, 0, WorkerThread, expected, 0, &tid);
|
||||
+ MessageBoxA(NULL, "Message", msgbox_title, MB_OK);
|
||||
+ ok(WaitForSingleObject(hthread, 2000) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
|
||||
+ CloseHandle(hthread);
|
||||
+
|
||||
+ CreateThread(NULL, 0, WorkerThread, &expectedOkCancel, 0, &tid);
|
||||
+ expected = create_msgbox_message(102 /* OK */, 105 /* Cancel */, 0);
|
||||
+ hthread = CreateThread(NULL, 0, WorkerThread, expected, 0, &tid);
|
||||
+ MessageBoxA(NULL, "Message", msgbox_title, MB_OKCANCEL);
|
||||
+ ok(WaitForSingleObject(hthread, 2000) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
|
||||
+ CloseHandle(hthread);
|
||||
+
|
||||
+ CreateThread(NULL, 0, WorkerThread, &expectedAbortRetryIgnore, 0, &tid);
|
||||
+ expected = create_msgbox_message(103 /* Abort */, 104 /* Retry */, 106 /* Ignore */);
|
||||
+ hthread = CreateThread(NULL, 0, WorkerThread, expected, 0, &tid);
|
||||
+ MessageBoxA(NULL, "Message", msgbox_title, MB_ABORTRETRYIGNORE);
|
||||
+ ok(WaitForSingleObject(hthread, 2000) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
|
||||
+ CloseHandle(hthread);
|
||||
+
|
||||
+ CreateThread(NULL, 0, WorkerThread, &expectedYesNo, 0, &tid);
|
||||
+ expected = create_msgbox_message(100 /* Yes */, 101 /* No */, 0);
|
||||
+ hthread = CreateThread(NULL, 0, WorkerThread, expected, 0, &tid);
|
||||
+ MessageBoxA(NULL, "Message", msgbox_title, MB_YESNO);
|
||||
+ ok(WaitForSingleObject(hthread, 2000) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
|
||||
+ CloseHandle(hthread);
|
||||
+
|
||||
+ CreateThread(NULL, 0, WorkerThread, &expectedYesNoCancel, 0, &tid);
|
||||
+ expected = create_msgbox_message(100 /* Yes */, 101 /* No */, 105 /* Cancel */);
|
||||
+ hthread = CreateThread(NULL, 0, WorkerThread, expected, 0, &tid);
|
||||
+ MessageBoxA(NULL, "Message", msgbox_title, MB_YESNOCANCEL);
|
||||
+ ok(WaitForSingleObject(hthread, 2000) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
|
||||
+ CloseHandle(hthread);
|
||||
+
|
||||
+ CreateThread(NULL, 0, WorkerThread, &expectedRetryCancel, 0, &tid);
|
||||
+ expected = create_msgbox_message(104 /* Retry */, 105 /* Cancel */, 0);
|
||||
+ hthread = CreateThread(NULL, 0, WorkerThread, expected, 0, &tid);
|
||||
+ MessageBoxA(NULL, "Message", msgbox_title, MB_RETRYCANCEL);
|
||||
+ ok(WaitForSingleObject(hthread, 2000) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
|
||||
+ CloseHandle(hthread);
|
||||
+
|
||||
+ CreateThread(NULL, 0, WorkerThread, &expectedCancelTryContinue, 0, &tid);
|
||||
+ expected = create_msgbox_message(105 /* Cancel */, 107 /* Try again */, 108 /* Continue */);
|
||||
+ hthread = CreateThread(NULL, 0, WorkerThread, expected, 0, &tid);
|
||||
+ MessageBoxA(NULL, "Message", msgbox_title, MB_CANCELTRYCONTINUE);
|
||||
+ ok(WaitForSingleObject(hthread, 2000) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
|
||||
+ CloseHandle(hthread);
|
||||
+}
|
||||
+
|
||||
static void test_SaveRestoreFocus(void)
|
||||
{
|
||||
HWND hDlg;
|
||||
@@ -2455,4 +2636,5 @@ START_TEST(dialog)
|
||||
test_timer_message();
|
||||
test_MessageBox();
|
||||
test_capture_release();
|
||||
@@ -2440,6 +2605,7 @@ START_TEST(dialog)
|
||||
|
||||
if (!RegisterWindowClasses()) assert(0);
|
||||
|
||||
+ test_MessageBox_WM_COPY_Test();
|
||||
test_dialog_custom_data();
|
||||
test_GetNextDlgItem();
|
||||
test_IsDialogMessage();
|
||||
diff --git a/dlls/user32/tests/resource.rc b/dlls/user32/tests/resource.rc
|
||||
index a957e50689d..5056386ff0e 100644
|
||||
--- a/dlls/user32/tests/resource.rc
|
||||
+++ b/dlls/user32/tests/resource.rc
|
||||
@@ -42,6 +42,17 @@ STRINGTABLE
|
||||
0 "String resource"
|
||||
1 "Another string resource"
|
||||
2 L"This is a wide string resource"
|
||||
+
|
||||
+ 100 "Yes"
|
||||
+ 101 "No"
|
||||
+ 102 "OK"
|
||||
+ 103 "Abort"
|
||||
+ 104 "Retry"
|
||||
+ 105 "Cancel"
|
||||
+ 106 "Ignore"
|
||||
+ 107 "Try Again"
|
||||
+ 108 "Continue"
|
||||
+
|
||||
65534 "Test high id"
|
||||
}
|
||||
|
||||
--
|
||||
2.40.1
|
||||
2.43.0
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
From 05f0a7d14311569807af62cc87780a67cb26194a Mon Sep 17 00:00:00 2001
|
||||
From 7e889b2ef650e4805128220aa3b56fbf5a0514b1 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 10 Jan 2019 16:17:33 +1100
|
||||
Subject: [PATCH] user32/msgbox: Use a windows hook to trap Ctrl+C
|
||||
Date: Wed, 6 Mar 2024 20:21:36 +1100
|
||||
Subject: [PATCH 2/2] user32/msgbox: Use a windows hook to trap Ctrl+C
|
||||
|
||||
---
|
||||
dlls/user32/msgbox.c | 20 ++++++++++++++++++++
|
||||
1 file changed, 20 insertions(+)
|
||||
|
||||
diff --git a/dlls/user32/msgbox.c b/dlls/user32/msgbox.c
|
||||
index d47d9eaac22..cf00d69df69 100644
|
||||
index 6b5d867eb1f..bf28413f39d 100644
|
||||
--- a/dlls/user32/msgbox.c
|
||||
+++ b/dlls/user32/msgbox.c
|
||||
@@ -388,6 +388,22 @@ static void MSGBOX_CopyToClipbaord( HWND hwnd )
|
||||
@@ -391,6 +391,22 @@ static void MSGBOX_CopyToClipbaord( HWND hwnd )
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ index d47d9eaac22..cf00d69df69 100644
|
||||
/**************************************************************************
|
||||
* MSGBOX_DlgProc
|
||||
*
|
||||
@@ -403,6 +419,7 @@ static INT_PTR CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,
|
||||
@@ -406,6 +422,7 @@ static INT_PTR CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,
|
||||
SetWindowContextHelpId(hwnd, mbp->dwContextHelpId);
|
||||
MSGBOX_OnInit(hwnd, mbp);
|
||||
SetPropA(hwnd, "WINE_MSGBOX_HELPCALLBACK", mbp->lpfnMsgBoxCallback);
|
||||
@ -42,7 +42,7 @@ index d47d9eaac22..cf00d69df69 100644
|
||||
break;
|
||||
}
|
||||
case WM_COPY:
|
||||
@@ -410,6 +427,9 @@ static INT_PTR CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,
|
||||
@@ -413,6 +430,9 @@ static INT_PTR CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,
|
||||
MSGBOX_CopyToClipbaord(hwnd);
|
||||
break;
|
||||
}
|
||||
@ -53,5 +53,5 @@ index d47d9eaac22..cf00d69df69 100644
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam))
|
||||
--
|
||||
2.35.1
|
||||
2.43.0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user