https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d6c70f08642cfc414009d…
commit d6c70f08642cfc414009d6968d8c722c9b172a8c
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Mon Jan 1 11:01:59 2024 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Jan 1 11:01:59 2024 +0900
[COMCTL32][USER32] RadioButton: Notify BN_CLICKED on WM_SETFOCUS (#6266)
Based on KRosUser's button_fixnotif.patch.
JIRA issue: CORE-6542, CORE-19384
Notify BN_CLICKED to the parent on WM_SETFOCUS message
handling if the button type was either BS_RADIOBUTTON or
BS_AUTORADIOBUTTON, and if the button was unchecked.
---
dll/win32/comctl32/button.c | 7 +++++++
win32ss/user/user32/controls/button.c | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/dll/win32/comctl32/button.c b/dll/win32/comctl32/button.c
index d187ca4f1f2..9002697d60c 100644
--- a/dll/win32/comctl32/button.c
+++ b/dll/win32/comctl32/button.c
@@ -1043,6 +1043,13 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg,
WPARAM wParam, L
paint_button( infoPtr, btn_type, ODA_FOCUS );
if (style & BS_NOTIFY)
BUTTON_NOTIFY_PARENT(hWnd, BN_SETFOCUS);
+#ifdef __REACTOS__
+ if (((btn_type == BS_RADIOBUTTON) || (btn_type == BS_AUTORADIOBUTTON))
&&
+ !(infoPtr->state & BST_CHECKED))
+ {
+ BUTTON_NOTIFY_PARENT(hWnd, BN_CLICKED);
+ }
+#endif
break;
case WM_KILLFOCUS:
diff --git a/win32ss/user/user32/controls/button.c
b/win32ss/user/user32/controls/button.c
index 7f220ed450a..95d98e4e9d7 100644
--- a/win32ss/user/user32/controls/button.c
+++ b/win32ss/user/user32/controls/button.c
@@ -532,6 +532,13 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
paint_button( hWnd, btn_type, ODA_FOCUS );
if (style & BS_NOTIFY)
BUTTON_NOTIFY_PARENT(hWnd, BN_SETFOCUS);
+#ifdef __REACTOS__
+ if (((btn_type == BS_RADIOBUTTON) || (btn_type == BS_AUTORADIOBUTTON))
&&
+ !(get_button_state(hWnd) & BST_CHECKED))
+ {
+ BUTTON_NOTIFY_PARENT(hWnd, BN_CLICKED);
+ }
+#endif
break;
case WM_KILLFOCUS: