From c40c1b95a75c09d5eef680291444bd378383285b Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Fri, 29 Dec 2023 18:01:32 +0200 Subject: [PATCH] Fix missing dark mode support in some dialogs. --- od-win32/hardfile_win32.cpp | 18 ++++++++++++++++++ od-win32/win32gui.cpp | 12 ++++++++---- od-win32/win32gui.h | 1 + 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/od-win32/hardfile_win32.cpp b/od-win32/hardfile_win32.cpp index 897a98e3..27f49c35 100644 --- a/od-win32/hardfile_win32.cpp +++ b/od-win32/hardfile_win32.cpp @@ -439,6 +439,12 @@ static const TCHAR *hdz[] = { _T("hdz"), _T("zip"), _T("rar"), _T("7z"), NULL }; static INT_PTR CALLBACK ProgressDialogProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { + bool handled; + INT_PTR vv = commonproc2(hDlg, msg, wParam, lParam, &handled); + if (handled) { + return vv; + } + switch(msg) { case WM_DESTROY: @@ -1347,6 +1353,12 @@ static bool hd_get_meta_satl(HWND hDlg, HANDLE h, uae_u8 *data, TCHAR *text, str static INT_PTR CALLBACK CHSDialogProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { + bool handled; + INT_PTR vv = commonproc2(hDlg, msg, wParam, lParam, &handled); + if (handled) { + return vv; + } + switch (msg) { case WM_DESTROY: @@ -1477,6 +1489,12 @@ static TCHAR geometry_file[MAX_DPATH]; static struct ini_data *hdini; static INT_PTR CALLBACK StringBoxDialogProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { + bool handled; + INT_PTR vv = commonproc2(hDlg, msg, wParam, lParam, &handled); + if (handled) { + return vv; + } + switch(msg) { case WM_DESTROY: diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 048018d6..85a0225c 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -431,7 +431,7 @@ static int gui_get_string_cursor(int *table, HWND hDlg, int item) return table[posn]; } -static INT_PTR commonproc2(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam, bool *handled) +INT_PTR commonproc2(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam, bool *handled) { if (dialog_inhibit) { *handled = true; @@ -19464,10 +19464,14 @@ static void remapspeciallistview(HWND list) static INT_PTR CALLBACK RemapSpecialsProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { static int recursive = 0; - HWND list = GetDlgItem(hDlg, IDC_LISTDIALOG_LIST); - if (dialog_inhibit) - return 0; + bool handled; + INT_PTR vv = commonproc2(hDlg, msg, wParam, lParam, &handled); + if (handled) { + return vv; + } + + HWND list = GetDlgItem(hDlg, IDC_LISTDIALOG_LIST); switch (msg) { diff --git a/od-win32/win32gui.h b/od-win32/win32gui.h index 256f988c..f073680b 100644 --- a/od-win32/win32gui.h +++ b/od-win32/win32gui.h @@ -146,6 +146,7 @@ extern void scaleresource_setsize (int w, int h, int fs); extern HWND CustomCreateDialog(int templ, HWND hDlg, DLGPROC proc, struct customdialogstate *cds); extern void CustomDialogClose(HWND, int); extern INT_PTR CustomDialogBox (int templ, HWND hDlg, DLGPROC proc); +INT_PTR commonproc2(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam, bool *handled); extern struct newresource *getresource (int tmpl); extern void scaleresource_init(const TCHAR*, int); extern int scaleresource_choosefont (HWND hDlg, int fonttype); -- 2.47.3