From be1b8c9e1e7cc0c523163b965b3ec6ee8b3699ba Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Sat, 19 May 2018 18:28:18 +0300 Subject: [PATCH] comctl32/taskdialog: Add a helper to initialize dialog data. Signed-off-by: Zhiyi Zhang Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/comctl32/taskdialog.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/taskdialog.c b/dlls/comctl32/taskdialog.c index ba19ed51a64..644f60fbb81 100644 --- a/dlls/comctl32/taskdialog.c +++ b/dlls/comctl32/taskdialog.c @@ -533,6 +533,11 @@ static void taskdialog_on_button_click(struct taskdialog_info *dialog_info, WORD EndDialog(dialog_info->hwnd, command_id); } +static void taskdialog_init(struct taskdialog_info *dialog_info, HWND hwnd) +{ + dialog_info->hwnd = hwnd; +} + static INT_PTR CALLBACK taskdialog_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { static const WCHAR taskdialog_info_propnameW[] = {'T','a','s','k','D','i','a','l','o','g','I','n','f','o',0}; @@ -550,9 +555,10 @@ static INT_PTR CALLBACK taskdialog_proc(HWND hwnd, UINT msg, WPARAM wParam, LPAR break; case WM_INITDIALOG: dialog_info = (struct taskdialog_info *)lParam; - dialog_info->hwnd = hwnd; - SetPropW(hwnd, taskdialog_info_propnameW, dialog_info); + taskdialog_init(dialog_info, hwnd); + + SetPropW(hwnd, taskdialog_info_propnameW, dialog_info); taskdialog_notify(dialog_info, TDN_DIALOG_CONSTRUCTED, 0, 0); break; case WM_SHOWWINDOW: