From a9911ff6d7d0c77a3293b56570e55a2a4ea09213 Mon Sep 17 00:00:00 2001 From: rheiny Date: Thu, 3 Aug 2006 19:48:05 +0000 Subject: [PATCH] CenterWindow now with less build breaking --- src/drivers/win/debugger.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/drivers/win/debugger.cpp b/src/drivers/win/debugger.cpp index 78b14006..9ca82a60 100644 --- a/src/drivers/win/debugger.cpp +++ b/src/drivers/win/debugger.cpp @@ -68,6 +68,8 @@ void CenterWindow(HWND hwndDlg) { //TODO: This function should probably moved into the generic Win32 window file //move the window relative to its parent HWND hwndParent = GetParent(hwndDlg); + RECT rect; + RECT rectP; GetWindowRect(hwndDlg, &rect); GetWindowRect(hwndParent, &rectP); @@ -75,8 +77,8 @@ void CenterWindow(HWND hwndDlg) { unsigned int width = rect.right - rect.left; unsigned height = rect.bottom - rect.top; - x = ((rectP.right-rectP.left) - width) / 2 + rectP.left; - y = ((rectP.bottom-rectP.top) - height) / 2 + rectP.top; + unsigned x = ((rectP.right-rectP.left) - width) / 2 + rectP.left; + unsigned y = ((rectP.bottom-rectP.top) - height) / 2 + rectP.top; unsigned screenwidth = GetSystemMetrics(SM_CXSCREEN); unsigned screenheight = GetSystemMetrics(SM_CYSCREEN);