Updated user32-msgbox-Support-WM_COPY-mesg patchset

This commit is contained in:
Alistair Leslie-Hughes 2019-01-11 09:17:29 +11:00
parent a7ad40c135
commit 929bc28ac8
3 changed files with 72 additions and 5 deletions

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "807e5fc04af7a7ea563af1e7da6ebe6662536e6b"
echo "2d6de2d129b39d2a0c4ffafa84dabed21c0e830e"
}
# Show version information
@ -6573,8 +6573,10 @@ fi
# |
if test "$enable_user32_msgbox_Support_WM_COPY_mesg" -eq 1; then
patch_apply user32-msgbox-Support-WM_COPY-mesg/0001-user32-msgbox-Support-WM_COPY-Message.patch
patch_apply user32-msgbox-Support-WM_COPY-mesg/0002-user32-msgbox-Use-a-windows-hook-to-trap-Ctrl-C.patch
(
printf '%s\n' '+ { "Alistair Leslie-Hughes", "user32/msgbox: Support WM_COPY Message.", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "user32/msgbox: Use a windows hook to trap Ctrl+C.", 1 },';
) >> "$patchlist"
fi

View File

@ -1,4 +1,4 @@
From 1e0e23280f08a6ff0a3bcbf36255c5743f48d1d1 Mon Sep 17 00:00:00 2001
From 48940cf80a165efd218fed37d4d964197cccf36a 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
@ -130,7 +130,7 @@ index 457c3ae..8a1b89f 100644
case WM_COMMAND:
switch (LOWORD(wParam))
diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c
index 631f3d3..6f10391 100644
index 8c9bd21..139d589 100644
--- a/dlls/user32/tests/dialog.c
+++ b/dlls/user32/tests/dialog.c
@@ -40,6 +40,7 @@
@ -141,7 +141,7 @@ index 631f3d3..6f10391 100644
#define MAXHWNDS 1024
static HWND hwnd [MAXHWNDS];
@@ -1900,6 +1901,187 @@ static void test_MessageBoxFontTest(void)
@@ -1973,6 +1974,187 @@ static void test_MessageBoxFontTest(void)
DestroyWindow(hDlg);
}
@ -329,7 +329,7 @@ index 631f3d3..6f10391 100644
static void test_SaveRestoreFocus(void)
{
HWND hDlg;
@@ -2103,4 +2285,5 @@ START_TEST(dialog)
@@ -2176,4 +2358,5 @@ START_TEST(dialog)
test_SaveRestoreFocus();
test_timer_message();
test_MessageBox();

View File

@ -0,0 +1,65 @@
From 27c59d8785c0c81039c4c307496c1e64d896a333 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
---
dlls/user32/msgbox.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/msgbox.c b/dlls/user32/msgbox.c
index 8a1b89f..52b0852 100644
--- a/dlls/user32/msgbox.c
+++ b/dlls/user32/msgbox.c
@@ -388,6 +388,22 @@ static void MSGBOX_CopyToClipbaord( HWND hwnd )
}
}
+HHOOK msghook_handle;
+
+LRESULT CALLBACK msg_hook_proc(int nCode, WPARAM wParam, LPARAM lParam)
+{
+ MSG *msg = (MSG *)lParam;
+ if (nCode == MSGF_DIALOGBOX && msg->message == WM_KEYUP)
+ {
+ if ( (msg->wParam == 'C' || msg->wParam == 'c') && (GetKeyState(VK_CONTROL) & 0x8000))
+ {
+ MSGBOX_CopyToClipbaord(GetParent(msg->hwnd));
+ }
+ }
+
+ return CallNextHookEx(msghook_handle, nCode, wParam, lParam);
+}
+
/**************************************************************************
* MSGBOX_DlgProc
*
@@ -403,6 +419,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);
+ msghook_handle = SetWindowsHookExA(WH_MSGFILTER, msg_hook_proc, GetModuleHandleA(NULL), 0);
break;
}
case WM_COPY:
@@ -410,6 +427,9 @@ static INT_PTR CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,
MSGBOX_CopyToClipbaord(hwnd);
break;
}
+ case WM_DESTROY:
+ UnhookWindowsHookEx(msghook_handle);
+ break;
case WM_COMMAND:
switch (LOWORD(wParam))
@@ -454,7 +474,6 @@ static INT_PTR CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,
return 0;
}
-
/**************************************************************************
* MessageBoxA (USER32.@)
*/
--
1.9.1