comctl32/taskdialog: Add support for TDM_{SET,UPDATE}_ELEMENT_TEXT.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2018-07-23 20:20:57 +08:00 committed by Alexandre Julliard
parent 5f849e6b42
commit c3cb1c78c4
1 changed files with 29 additions and 0 deletions

View File

@ -542,6 +542,28 @@ static void taskdialog_set_icon(struct taskdialog_info *dialog_info, INT element
SendMessageW(dialog_info->footer_icon, STM_SETICON, (WPARAM)hicon, 0);
}
static void taskdialog_set_element_text(struct taskdialog_info *dialog_info, TASKDIALOG_ELEMENTS element,
const WCHAR *text)
{
HWND hwnd = NULL;
WCHAR *textW;
if (element == TDE_CONTENT)
hwnd = dialog_info->content;
else if (element == TDE_EXPANDED_INFORMATION)
hwnd = dialog_info->expanded_info;
else if (element == TDE_FOOTER)
hwnd = dialog_info->footer_text;
else if (element == TDE_MAIN_INSTRUCTION)
hwnd = dialog_info->main_instruction;
if (!hwnd) return;
textW = taskdialog_gettext(dialog_info, TRUE, text);
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)textW);
Free(textW);
}
static void taskdialog_check_default_radio_buttons(struct taskdialog_info *dialog_info)
{
const TASKDIALOGCONFIG *taskconfig = dialog_info->taskconfig;
@ -1227,6 +1249,13 @@ static INT_PTR CALLBACK taskdialog_proc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
case TDM_SET_PROGRESS_BAR_MARQUEE:
SendMessageW(dialog_info->progress_bar, PBM_SETMARQUEE, wParam, lParam);
break;
case TDM_SET_ELEMENT_TEXT:
taskdialog_set_element_text(dialog_info, wParam, (const WCHAR *)lParam);
taskdialog_layout(dialog_info);
break;
case TDM_UPDATE_ELEMENT_TEXT:
taskdialog_set_element_text(dialog_info, wParam, (const WCHAR *)lParam);
break;
case TDM_CLICK_RADIO_BUTTON:
taskdialog_click_radio_button(dialog_info, wParam);
break;