svn path=/trunk/; revision=74186
{
RegistryBinaryConfig tConfig;
DWORD iBufferSize = sizeof(tConfig);
{
RegistryBinaryConfig tConfig;
DWORD iBufferSize = sizeof(tConfig);
if (RegQueryValueExW(hKey, L"View", NULL, NULL, (LPBYTE)&tConfig, &iBufferSize) == ERROR_SUCCESS)
{
if (RegQueryValueExW(hKey, L"View", NULL, NULL, (LPBYTE)&tConfig, &iBufferSize) == ERROR_SUCCESS)
{
/* Apply program window settings */
tConfig.tPlacement.length = sizeof(WINDOWPLACEMENT);
/* 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)
{
SelectNode(g_pChildWnd->hTreeWnd, szBuffer);
}
/* Restore key position */
if (QueryStringValue(HKEY_CURRENT_USER, g_szGeneralRegKey, L"LastKey", szBuffer, COUNT_OF(szBuffer)) == ERROR_SUCCESS)
{
SelectNode(g_pChildWnd->hTreeWnd, szBuffer);
}