[ros-diffs] [mkupfer] 34964: - center window only once - get path from executable module instead of current directory

mkupfer at svn.reactos.org mkupfer at svn.reactos.org
Wed Jul 30 20:54:06 CEST 2008


Author: mkupfer
Date: Wed Jul 30 13:54:05 2008
New Revision: 34964

URL: http://svn.reactos.org/svn/reactos?rev=34964&view=rev
Log:
- center window only once
- get path from executable module instead of current directory

Modified:
    trunk/reactos/base/setup/reactos/reactos.c

Modified: trunk/reactos/base/setup/reactos/reactos.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/reactos/reactos.c?rev=34964&r1=34963&r2=34964&view=diff
==============================================================================
--- trunk/reactos/base/setup/reactos/reactos.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/reactos/reactos.c [iso-8859-1] Wed Jul 30 13:54:05 2008
@@ -29,6 +29,7 @@
 #include <commctrl.h>
 #include <tchar.h>
 #include <setupapi.h>
+#include <wine/unicode.h>
 
 #include "resource.h"
 
@@ -210,9 +211,6 @@
 		DWORD dwStyle;
 
           	hwndControl = GetParent(hwndDlg);
-
-		/* Center the wizard window */
-                CenterWindow (hwndControl);
 
           	dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
 	        SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
@@ -309,9 +307,6 @@
 
           	hwndControl = GetParent(hwndDlg);
 
-		/* Center the wizard window */
-                CenterWindow (hwndControl);
-
           	dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
 	        SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
 		
@@ -364,9 +359,6 @@
 
           	hwndControl = GetParent(hwndDlg);
 
-		/* Center the wizard window */
-                CenterWindow (hwndControl);
-
           	dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
 	        SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
 		
@@ -416,9 +408,6 @@
 		DWORD dwStyle;
 
           	hwndControl = GetParent(hwndDlg);
-
-		/* Center the wizard window */
-                CenterWindow (hwndControl);
 
           	dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
 	        SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
@@ -471,9 +460,6 @@
 
           	hwndControl = GetParent(hwndDlg);
 
-		/* Center the wizard window */
-                CenterWindow (hwndControl);
-
           	dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
 	        SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
 		
@@ -524,9 +510,6 @@
 		DWORD dwStyle;
 
           	hwndControl = GetParent(hwndDlg);
-
-		/* Center the wizard window */
-                CenterWindow (hwndControl);
 
           	dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
 	        SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
@@ -586,6 +569,7 @@
 BOOL isUnattendSetup()
 {
 	WCHAR szPath[MAX_PATH];
+	WCHAR *ch;
 	HINF hUnattendedInf;
 	INFCONTEXT InfContext;
 	TCHAR szValue[MAX_PATH];
@@ -593,7 +577,10 @@
 	//HKEY hKey;
 	BOOL result = 0;
 
-	GetCurrentDirectoryW(MAX_PATH, szPath); // FIXME
+	GetModuleFileNameW(NULL,szPath,MAX_PATH);
+	ch = strrchrW(szPath,L'\\');
+	if (ch != NULL)
+		*ch = L'\0';
 
 	wcscat(szPath, L"\\unattend.inf");
 	hUnattendedInf = SetupOpenInfFileW(szPath, NULL, INF_STYLE_OLDNT, NULL);



More information about the Ros-diffs mailing list