From 860d61661b82198bae93736980c340f5d2c4e152 Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Sat, 9 May 2020 19:08:46 +0200 Subject: notebook: fix focus when changing tabs --- alf/alf.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'alf/alf.cpp') diff --git a/alf/alf.cpp b/alf/alf.cpp index 7c0fa2a..0ab1901 100644 --- a/alf/alf.cpp +++ b/alf/alf.cpp @@ -442,7 +442,7 @@ ALF_ShouldMessageBubble(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) || msg == WM_MEASUREITEM || msg == WM_DRAWITEM || msg == WM_CTLCOLORBTN || msg == WM_CTLCOLOREDIT || msg == WM_CTLCOLORLISTBOX || msg == WM_CTLCOLORSCROLLBAR - || msg == WM_CTLCOLORSTATIC; + || msg == WM_CTLCOLORSTATIC || msg == ALF_WM_SETFOCUS; } void @@ -503,3 +503,12 @@ ALF_SetTextColor(HWND win, ALFColor color) { SendMessage(win, ALF_WM_SETTEXTCOLOR, 0, (LPARAM)color); } + +void +ALF_SetFocus(HWND target) +{ + if (GetWindowStyle(target) & WS_CHILD) + PostMessage(GetParent(target), ALF_WM_SETFOCUS, 0, (LPARAM)target); + else + PostMessage(target, ALF_WM_SETFOCUS, 0, (LPARAM)target); +} -- cgit v1.2.3