From 2cdb83c8ffafa11eff202efa66dd7c3c03ead003 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 6 Apr 2020 04:39:23 +0200 Subject: [PATCH] Fix signature of FuncDlg properly Previous fix caused a small diff, see: https://docs.microsoft.com/en-us/previous-versions/ms960202%28v%3dmsdn.10%29 --- Source/appfat.cpp | 42 +++++++++++++++++++++--------------------- Source/appfat.h | 1 - 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/Source/appfat.cpp b/Source/appfat.cpp index fac368284..d6ccf73d7 100644 --- a/Source/appfat.cpp +++ b/Source/appfat.cpp @@ -573,6 +573,26 @@ void center_window(HWND hDlg) } } +static BOOL CALLBACK FuncDlg(HWND hDlg, UINT uMsg,WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) { + case WM_INITDIALOG: + TextDlg(hDlg, (char *)lParam); + break; + case WM_COMMAND: + if (LOWORD(wParam) == IDOK) { + EndDialog(hDlg, TRUE); + } else if (LOWORD(wParam) == IDCANCEL) { + EndDialog(hDlg, FALSE); + } + break; + default: + return FALSE; + } + + return TRUE; +} + void ErrDlg(int template_id, DWORD error_code, char *log_file_path, int log_line_nr) { char *size; @@ -591,27 +611,7 @@ void ErrDlg(int template_id, DWORD error_code, char *log_file_path, int log_line app_fatal(NULL); } -BOOL __stdcall FuncDlg(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM text) -{ - switch (uMsg) { - case WM_INITDIALOG: - TextDlg(hDlg, (char *)text); - break; - case WM_COMMAND: - if (wParam == IDOK) { - EndDialog(hDlg, TRUE); - } else if (wParam == IDCANCEL) { - EndDialog(hDlg, FALSE); - } - break; - default: - return FALSE; - } - - return TRUE; -} - -void TextDlg(HWND hDlg, char *text) +static void TextDlg(HWND hDlg, char *text) { center_window(hDlg); diff --git a/Source/appfat.h b/Source/appfat.h index ea335f09a..ab2154f09 100644 --- a/Source/appfat.h +++ b/Source/appfat.h @@ -29,7 +29,6 @@ void DDErrMsg(DWORD error_code, int log_line_nr, char *log_file_path); void DSErrMsg(DWORD error_code, int log_line_nr, char *log_file_path); void center_window(HWND hDlg); void ErrDlg(int template_id, DWORD error_code, char *log_file_path, int log_line_nr); -BOOL __stdcall FuncDlg(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM text); void TextDlg(HWND hDlg, char *text); void ErrOkDlg(int template_id, DWORD error_code, char *log_file_path, int log_line_nr); void FileErrDlg(const char *error);