[PATCH 07/18] comctl32: TaskDialog - Center window properly

Fabian Maurer dark.shadow4 at web.de
Sat Feb 25 10:01:35 CST 2017


Signed-off-by: Fabian Maurer <dark.shadow4 at web.de>
---
 dlls/comctl32/taskdialog.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/taskdialog.c b/dlls/comctl32/taskdialog.c
index 20d4e1ba32..36f90b9948 100644
--- a/dlls/comctl32/taskdialog.c
+++ b/dlls/comctl32/taskdialog.c
@@ -359,10 +359,12 @@ HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *pTaskConfig, int *pnBu
 
     header.template.style = DS_MODALFRAME | WS_CAPTION | WS_VISIBLE;
     header.template.cdit = list_count(controls);
-    header.template.x = 10;
-    header.template.y = 10;
+
+    /* TaskDialogs are always desktop centered */
     header.template.cx = dialog_width;
     header.template.cy = dialog_height;
+    header.template.x = (desktop.right - dialog_width)/2;
+    header.template.y = (desktop.bottom - dialog_height)/2;
 
     /* Turn template information into a dialog template to display it */
     template_data = dialog_template_create(header, controls);
-- 
2.12.0




More information about the wine-patches mailing list