From: Tim Clem tclem@codeweavers.com
--- dlls/comctl32/taskdialog.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/taskdialog.c b/dlls/comctl32/taskdialog.c index 420f4c6a248..a2e632af878 100644 --- a/dlls/comctl32/taskdialog.c +++ b/dlls/comctl32/taskdialog.c @@ -84,6 +84,7 @@ struct taskdialog_info BOOL has_cancel; WCHAR *expanded_text; WCHAR *collapsed_text; + BOOL had_first_layout; };
struct button_layout_info @@ -851,7 +852,6 @@ static void taskdialog_layout(struct taskdialog_info *dialog_info) { const TASKDIALOGCONFIG *taskconfig = dialog_info->taskconfig; BOOL syslink = taskdialog_hyperlink_enabled(dialog_info); - static BOOL first_time = TRUE; RECT ref_rect; LONG dialog_width, dialog_height = 0; LONG h_spacing, v_spacing; @@ -1074,12 +1074,12 @@ static void taskdialog_layout(struct taskdialog_info *dialog_info) dialog_height += GetSystemMetrics(SM_CYCAPTION); dialog_height += GetSystemMetrics(SM_CXDLGFRAME);
- if (first_time) + if (!dialog_info->had_first_layout) { x = (ref_rect.left + ref_rect.right - dialog_width) / 2; y = (ref_rect.top + ref_rect.bottom - dialog_height) / 2; SetWindowPos(dialog_info->hwnd, 0, x, y, dialog_width, dialog_height, SWP_NOZORDER); - first_time = FALSE; + dialog_info->had_first_layout = TRUE; } else SetWindowPos(dialog_info->hwnd, 0, 0, 0, dialog_width, dialog_height, SWP_NOMOVE | SWP_NOZORDER);