mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 20:03:12 +00:00
[REGEDIT] Fix regedit not showing it's main window when loading view settings fail. CORE-12749
svn path=/trunk/; revision=74186
This commit is contained in:
parent
7c59b923ac
commit
5d11d1699c
1 changed files with 7 additions and 4 deletions
|
@ -67,6 +67,7 @@ extern void LoadSettings(void)
|
||||||
{
|
{
|
||||||
RegistryBinaryConfig tConfig;
|
RegistryBinaryConfig tConfig;
|
||||||
DWORD iBufferSize = sizeof(tConfig);
|
DWORD iBufferSize = sizeof(tConfig);
|
||||||
|
BOOL bVisible = FALSE;
|
||||||
|
|
||||||
if (RegQueryValueExW(hKey, L"View", NULL, NULL, (LPBYTE)&tConfig, &iBufferSize) == ERROR_SUCCESS)
|
if (RegQueryValueExW(hKey, L"View", NULL, NULL, (LPBYTE)&tConfig, &iBufferSize) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
@ -90,19 +91,21 @@ extern void LoadSettings(void)
|
||||||
|
|
||||||
/* Apply program window settings */
|
/* Apply program window settings */
|
||||||
tConfig.tPlacement.length = sizeof(WINDOWPLACEMENT);
|
tConfig.tPlacement.length = sizeof(WINDOWPLACEMENT);
|
||||||
if (SetWindowPlacement(hFrameWnd, &tConfig.tPlacement) == FALSE)
|
bVisible = SetWindowPlacement(hFrameWnd, &tConfig.tPlacement);
|
||||||
/* In case we fail, show normal */
|
|
||||||
ShowWindow(hFrameWnd, SW_SHOWNORMAL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* In case we fail to restore the window, or open the key, show normal */
|
||||||
|
if (!bVisible)
|
||||||
|
ShowWindow(hFrameWnd, SW_SHOWNORMAL);
|
||||||
|
|
||||||
/* Restore key position */
|
/* Restore key position */
|
||||||
if (QueryStringValue(HKEY_CURRENT_USER, g_szGeneralRegKey, L"LastKey", szBuffer, COUNT_OF(szBuffer)) == ERROR_SUCCESS)
|
if (QueryStringValue(HKEY_CURRENT_USER, g_szGeneralRegKey, L"LastKey", szBuffer, COUNT_OF(szBuffer)) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
SelectNode(g_pChildWnd->hTreeWnd, szBuffer);
|
SelectNode(g_pChildWnd->hTreeWnd, szBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue