Author: mjansen
Date: Sat Mar 18 12:54:43 2017
New Revision: 74186
URL:
http://svn.reactos.org/svn/reactos?rev=74186&view=rev
Log:
[REGEDIT] Fix regedit not showing it's main window when loading view settings fail.
CORE-12749
Modified:
trunk/reactos/base/applications/regedit/settings.c
Modified: trunk/reactos/base/applications/regedit/settings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
==============================================================================
--- trunk/reactos/base/applications/regedit/settings.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/regedit/settings.c [iso-8859-1] Sat Mar 18 12:54:43
2017
@@ -67,6 +67,7 @@
{
RegistryBinaryConfig tConfig;
DWORD iBufferSize = sizeof(tConfig);
+ BOOL bVisible = FALSE;
if (RegQueryValueExW(hKey, L"View", NULL, NULL, (LPBYTE)&tConfig,
&iBufferSize) == ERROR_SUCCESS)
{
@@ -90,11 +91,13 @@
/* Apply program window settings */
tConfig.tPlacement.length = sizeof(WINDOWPLACEMENT);
- if (SetWindowPlacement(hFrameWnd, &tConfig.tPlacement) == FALSE)
- /* In case we fail, show normal */
- ShowWindow(hFrameWnd, SW_SHOWNORMAL);
+ bVisible = SetWindowPlacement(hFrameWnd, &tConfig.tPlacement);
}
}
+
+ /* In case we fail to restore the window, or open the key, show normal */
+ if (!bVisible)
+ ShowWindow(hFrameWnd, SW_SHOWNORMAL);
/* Restore key position */
if (QueryStringValue(HKEY_CURRENT_USER, g_szGeneralRegKey, L"LastKey",
szBuffer, COUNT_OF(szBuffer)) == ERROR_SUCCESS)
@@ -102,7 +105,7 @@
SelectNode(g_pChildWnd->hTreeWnd, szBuffer);
}
- RegCloseKey(hKey);
+ RegCloseKey(hKey);
}
else
{