00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 #include "camtypes.h"
00108
00109
00110
00111 #include "camelot.h"
00112
00113
00114 #include "camdoc.h"
00115 #include "ccmdikid.h"
00116 #include "scrcamvw.h"
00117 #include "vstate.h"
00118 #include "rulers.h"
00119 #include "filedlgs.h"
00120 #include "registry.h"
00121 #include "statline.h"
00122
00123
00124
00125 DECLARE_SOURCE("$Revision: 1282 $");
00126
00127
00128
00129 BOOL fRestoreWorkspaceOnStartup = FALSE;
00130
00131
00132 HKEY hWorkspaceRegKey = 0;
00133
00134
00135 BOOL fDontMaximiseViews = FALSE;
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 static void MakeKeyFromView(HKEY hViewKey, ScreenCamView* pCamView)
00151 {
00152
00153 ERROR3IF(pCamView == NULL, "Null ScreenCamView* in MakeKeyFromView\n");
00154 ViewState* pvs = pCamView->GetViewState();
00155 ERROR3IF(pvs == NULL, "Null ViewState* in MakeKeyFromView\n");
00156 DocView* pdv = pCamView->GetDocViewPtr();
00157 ERROR3IF(pdv == NULL, "Null DocView* in MakeKeyFromView\n");
00158
00159
00160 SetRegValue(hViewKey, TEXT("FrameLoX"), REG_DWORD, &pvs->ViewRect.lo.x, sizeof(DWORD));
00161 SetRegValue(hViewKey, TEXT("FrameLoY"), REG_DWORD, &pvs->ViewRect.lo.y, sizeof(DWORD));
00162 SetRegValue(hViewKey, TEXT("FrameHiX"), REG_DWORD, &pvs->ViewRect.hi.x, sizeof(DWORD));
00163 SetRegValue(hViewKey, TEXT("FrameHiY"), REG_DWORD, &pvs->ViewRect.hi.y, sizeof(DWORD));
00164
00165
00166 SetRegValue(hViewKey, TEXT("IconX"), REG_DWORD, &pvs->IconPoint.x, sizeof(DWORD));
00167 SetRegValue(hViewKey, TEXT("IconY"), REG_DWORD, &pvs->IconPoint.y, sizeof(DWORD));
00168
00169
00170 DWORD dwScale = (DWORD) pvs->ViewScale.GetRawLong();
00171 SetRegValue(hViewKey, TEXT("Scale"), REG_DWORD, &dwScale, sizeof(DWORD));
00172
00173
00174 DWORD dwFlags = (pdv->ViewFlags.GuidesShow ? 0x2000 : 0) |
00175 (pdv->ViewFlags.GuidesSnap ? 0x1000 : 0) |
00176 (pdv->ViewFlags.LogicalView ? 0x0800 : 0) |
00177 (pdv->ViewFlags.PrintBorderShow ? 0x0400 : 0) |
00178 (pdv->ViewFlags.MagObjectsSnap ? 0x0200 : 0) |
00179 (pdv->ViewFlags.ObjectsSnap ? 0x0100 : 0) |
00180 (pdv->ViewFlags.GridSnap ? 0x0080 : 0) |
00181 (pdv->ViewFlags.GridShow ? 0x0040 : 0) |
00182
00183 (pvs->RulersVisible ? 0x0020 : 0) |
00184 (pvs->ScrollersVisible ? 0x0010 : 0) |
00185 (pvs->AlwaysOnTop ? 0x0008 : 0) |
00186 (pvs->IsMinimised ? 0x0004 : 0) |
00187 (pvs->IsMaximised ? 0x0002 : 0) |
00188
00189 (pCamView->IsTopmost() ? 0x0001 : 0);
00190
00191 SetRegValue(hViewKey, TEXT("Flags"), REG_DWORD, &dwFlags, sizeof(DWORD));
00192
00193
00194 UINT32 nLow;
00195 INT32 nHigh;
00196 WorkCoord wcScroll = pvs->GetScrollPos(TRUE);
00197
00198
00199 wcScroll.x.GetHighLow(&nHigh, &nLow);
00200 SetRegValue(hViewKey, TEXT("ScrollLoX"), REG_DWORD, &nLow, sizeof(DWORD));
00201 SetRegValue(hViewKey, TEXT("ScrollHiX"), REG_DWORD, &nHigh, sizeof(DWORD));
00202
00203
00204 wcScroll.y.GetHighLow(&nHigh, &nLow);
00205 SetRegValue(hViewKey, TEXT("ScrollLoY"), REG_DWORD, &nLow, sizeof(DWORD));
00206 SetRegValue(hViewKey, TEXT("ScrollHiY"), REG_DWORD, &nHigh, sizeof(DWORD));
00207
00208
00209 SetRegValue(hViewKey, TEXT("zOrder"), REG_DWORD, &(pvs->zPos), sizeof(DWORD));
00210 }
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227 static ViewState* MakeViewStateFromKey(HKEY hViewKey, BOOL* pfHadFocus)
00228 {
00229
00230 ERROR3IF(!pfHadFocus, "No BOOL output parameter in MakeViewStateFromKey");
00231 ViewState* pvs = new ViewState;
00232 if (pvs == NULL)
00233 {
00234 TRACEUSER( "JustinF", _T("Couldn't allocate a ViewState in MakeViewStateFromKey\n"));
00235 return NULL;
00236 }
00237
00238
00239 pvs->ViewRect.lo.x = (INT32) GetRegDword(hViewKey, TEXT("FrameLoX"));
00240 pvs->ViewRect.lo.y = (INT32) GetRegDword(hViewKey, TEXT("FrameLoY"));
00241 pvs->ViewRect.hi.x = (INT32) GetRegDword(hViewKey, TEXT("FrameHiX"));
00242 pvs->ViewRect.hi.y = (INT32) GetRegDword(hViewKey, TEXT("FrameHiY"));
00243 pvs->IconPoint.x = (INT32) GetRegDword(hViewKey, TEXT("IconX"));
00244 pvs->IconPoint.y = (INT32) GetRegDword(hViewKey, TEXT("IconY"));
00245
00246
00247 INT32 nScale = (INT32) GetRegDword(hViewKey, TEXT("Scale"));
00248 pvs->ViewScale = FIXED16::FromRawLong(nScale);
00249
00250
00251 DWORD dwFlags = GetRegDword(hViewKey, TEXT("Flags"));
00252 pvs->RulersVisible = (dwFlags & 0x0020) ? TRUE : FALSE;
00253 pvs->ScrollersVisible = (dwFlags & 0x0010) ? TRUE : FALSE;
00254 pvs->AlwaysOnTop = (dwFlags & 0x0008) ? TRUE : FALSE;
00255 pvs->IsMinimised = (dwFlags & 0x0004) ? TRUE : FALSE;
00256
00257
00258 pvs->IsMaximised = FALSE;
00259
00260
00261 *pfHadFocus = (dwFlags & 0x0001) ? TRUE : FALSE;
00262
00263
00264
00265
00266 pvs->_GridShow = (dwFlags & 0x0040) ? TRUE : FALSE;
00267 pvs->_GridSnap = (dwFlags & 0x0080) ? TRUE : FALSE;
00268 pvs->_ObjectsSnap = (dwFlags & 0x0100) ? TRUE : FALSE;
00269 pvs->_MagObjectsSnap = (dwFlags & 0x0200) ? TRUE : FALSE;
00270 pvs->_PrintBorderShow = (dwFlags & 0x0400) ? TRUE : FALSE;
00271 pvs->_LogicalView = (dwFlags & 0x0800) ? TRUE : FALSE;
00272 pvs->_GuidesSnap = (dwFlags & 0x1000) ? TRUE : FALSE;
00273 pvs->_GuidesShow = (dwFlags & 0x2000) ? TRUE : FALSE;
00274
00275
00276
00277 pvs->IsNewView = FALSE;
00278
00279
00280 UINT32 xlow = GetRegDword(hViewKey, TEXT("ScrollLoX"));
00281 UINT32 ylow = GetRegDword(hViewKey, TEXT("ScrollLoY"));
00282 INT32 xhigh = (INT32) GetRegDword(hViewKey, TEXT("ScrollHiX"));
00283 INT32 yhigh = (INT32) GetRegDword(hViewKey, TEXT("ScrollHiY"));
00284
00285
00286 WorkCoord wc;
00287 wc.x.SetHighLow(xhigh, xlow);
00288 wc.y.SetHighLow(yhigh, ylow);
00289 pvs->SetScrollPos(wc, FALSE);
00290
00291
00292 pvs->zPos = GetRegDword(hViewKey, TEXT("zOrder"));
00293
00294
00295 return pvs;
00296 }
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312 BOOL SaveAppWindowState(BOOL fAutoRestart)
00313 {
00314
00315 if (IsWin32s() && !IsWin32c()) return FALSE;
00316
00317
00318
00319 static BOOL fHasBeenCalled = FALSE;
00320 if (fHasBeenCalled) return TRUE;
00321 fHasBeenCalled = TRUE;
00322
00323
00324 CMainFrame* pMainWnd = GetMainFrame();
00325 if (pMainWnd != NULL)
00326 {
00327 pMainWnd->UpdateStatusBarText(&String_256(_R(IDS_SAVING_WORKSPACE_MSG)), FALSE);
00328 }
00329
00330
00331 HKEY hMDIKey = CreateRegKey(hAppStateRegKey, TEXT("Workspace\\MDI"));
00332 if (hMDIKey == NULL)
00333 {
00334 ERROR3("Can't get an MDI key in SaveAppWindowState");
00335 return FALSE;
00336 }
00337
00338
00339 Document* pKernelDoc = Document::GetSelected();
00340 if (pKernelDoc == NULL)
00341 {
00342
00343 TRACEUSER( "JustinF", _T("No docs open so nothing to do in SaveAppWindowState\n"));
00344
00345
00346 DWORD n = 0;
00347 SetRegValue(hMDIKey, TEXT("OpenDocCount"), REG_DWORD, &n, sizeof(DWORD));
00348 SetRegValue(hMDIKey, TEXT("TotalViewCount"), REG_DWORD, &n, sizeof(DWORD));
00349 CloseRegKey(hMDIKey);
00350 return TRUE;
00351 }
00352
00353
00354 DWORD nDocs = 0;
00355 INT32 nTotalViewCount = 0;
00356
00357
00358 POSITION posTmp = AfxGetApp()->GetFirstDocTemplatePosition();
00359 while (posTmp)
00360 {
00361
00362 CDocTemplate* pTemplate = AfxGetApp()->GetNextDocTemplate(posTmp);
00363
00364
00365 POSITION posDoc = pTemplate->GetFirstDocPosition();
00366 while (posDoc)
00367 {
00368
00369 CCamDoc* pDoc = (CCamDoc*) pTemplate->GetNextDoc(posDoc);
00370 #if (_OLE_VER >= 0x200)
00371 if (pDoc->IsEmbedded() || pDoc->GetKernelDoc()->IsAHiddenDoc()) continue;
00372 #endif
00373
00374
00375 TCHAR szDocID[32];
00376 ::wsprintf(szDocID, TEXT("Doc %lu"), ++nDocs);
00377 HKEY hDocKey = CreateRegKey(hMDIKey, szDocID);
00378 if (hDocKey == NULL)
00379 {
00380 ERROR3("Can't get a doc sub-key in SaveAppWindowState");
00381 CloseRegKey(hMDIKey);
00382 return FALSE;
00383 }
00384
00385
00386 DWORD nViews = 0;
00387 POSITION posView = pDoc->GetFirstViewPosition();
00388 while (posView)
00389 {
00390
00391 ScreenCamView* pView = (ScreenCamView*) pDoc->GetNextView(posView);
00392
00393
00394 TCHAR szViewID[32];
00395 ::wsprintf(szViewID, TEXT("View %lu"), ++nViews);
00396 HKEY hViewKey = CreateRegKey(hDocKey, szViewID);
00397 if (hViewKey == NULL)
00398 {
00399 ERROR3("Can't get a view sub-key in SaveAppWindowState");
00400 CloseRegKey(hDocKey);
00401 CloseRegKey(hMDIKey);
00402 return FALSE;
00403 }
00404
00405
00406 MakeKeyFromView(hViewKey, pView);
00407 CloseRegKey(hViewKey);
00408
00409
00410 nTotalViewCount++;
00411 }
00412
00413
00414 CString strDocPath = pDoc->GetPathName();
00415 if (strDocPath.IsEmpty())
00416 {
00417
00418
00419
00420
00421 strDocPath = pDoc->GetOriginalPath();
00422 if (strDocPath.IsEmpty()) strDocPath = TEXT("");
00423 }
00424
00425
00426 SetRegValue(hDocKey, TEXT("FilePath"), REG_SZ,
00427 (LPCTSTR) strDocPath, strDocPath.GetLength() + 1);
00428 SetRegValue(hDocKey, TEXT("AttachedViewCount"), REG_DWORD, &nViews, sizeof(DWORD));
00429 CloseRegKey(hDocKey);
00430 }
00431 }
00432
00433
00434 SetRegValue(hMDIKey, TEXT("OpenDocCount"), REG_DWORD, &nDocs, sizeof(DWORD));
00435 SetRegValue(hMDIKey, TEXT("TotalViewCount"), REG_DWORD, &nTotalViewCount, sizeof(DWORD));
00436
00437 CloseRegKey(hMDIKey);
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465 if (fAutoRestart)
00466 {
00467
00468 HKEY hRunOnceKey = CreateRegKey(HKEY_CURRENT_USER,
00469 TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce"));
00470 if (hRunOnceKey == NULL)
00471 {
00472 ERROR3("Can't get a RunOnce key in SaveAppWindowState");
00473 return FALSE;
00474 }
00475
00476
00477 TCHAR szAutoCmd[_MAX_PATH * 2];
00478 ::wsprintf(szAutoCmd, TEXT("%s /Restore"), (LPCTSTR) szCamelotExePath);
00479 SetRegValue(hRunOnceKey, szCamelotAppRegistryID, REG_SZ,
00480 szAutoCmd, ::camStrlen(szAutoCmd));
00481 CloseRegKey(hRunOnceKey);
00482
00483
00484 TRACEUSER( "JustinF", _T("\nSee you later . . .\n\n"));
00485 StatusLine::SetPrefix(String_256(_R(IDS_SEE_YOU_LATER_MSG)));
00486 }
00487
00488
00489 return TRUE;
00490 }
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508 BOOL LoadAppWindowState(CWnd* pSplashBox)
00509 {
00510
00511 if (!fRestoreWorkspaceOnStartup || (IsWin32s() && !IsWin32c())) return FALSE;
00512
00513
00514 HKEY hWorkspaceKey = CreateRegKey(hAppStateRegKey, TEXT("Workspace"));
00515 if (hWorkspaceKey == NULL)
00516 {
00517 ERROR3("Can't get a workspace key in LoadAppWindowState");
00518 return FALSE;
00519 }
00520
00521 HKEY hMDIKey = CreateRegKey(hWorkspaceKey, TEXT("MDI"));
00522 if (hMDIKey == NULL)
00523 {
00524 ERROR3("Can't get an MDI key in LoadAppWindowState");
00525 CloseRegKey(hWorkspaceKey);
00526 return FALSE;
00527 }
00528
00529
00530 StatusLine::SetPrefix(String_64(_R(IDS_LOADING_WORKSPACE_MSG)));
00531
00532
00533 BaseFileDialog::SelectedFilter = 0;
00534
00535
00536 INT32 nTotalDocs = GetRegDword(hMDIKey, TEXT("OpenDocCount"));
00537 INT32 nTotalViews = GetRegDword(hMDIKey, TEXT("TotalViewCount"));
00538
00539
00540
00541 fDontMaximiseViews = (nTotalViews > 1);
00542
00543
00544 CCamMDIChild** pzOrder = new CCamMDIChild*[nTotalViews];
00545 ERRORIF(pzOrder == NULL, FALSE, _R(IDE_NOMORE_MEMORY));
00546 memset(pzOrder, (INT32) NULL, nTotalViews * sizeof(CCamMDIChild*));
00547
00548
00549
00550 CCamMDIChild* pFocusFrame = NULL;
00551 BOOL fAtLeastOneLoaded = FALSE;
00552 for (DWORD nDoc = 1; nDoc <= (DWORD) nTotalDocs; nDoc++)
00553 {
00554
00555
00556
00557 TCHAR szDocID[32];
00558 ::wsprintf(szDocID, TEXT("Doc %ld"), nDoc);
00559 HKEY hDocKey = OpenRegKey(hMDIKey, szDocID);
00560 if (hDocKey == NULL)
00561 {
00562 TRACEUSER( "JustinF", _T("Can't find %s sub-key in LoadAppWindowState\n"), (LPCTSTR) szDocID);
00563 continue;
00564 }
00565
00566
00567 String_256 strPath;
00568 if (!GetRegString(hDocKey, TEXT("FilePath"), &strPath))
00569 {
00570 TRACEUSER( "JustinF", _T("Can't get file-path in LoadAppWindowState\n"));
00571 continue;
00572 }
00573
00574
00575
00576 #if (_MFC_VER < 0x400)
00577
00578 CPtrList& templateList = AfxGetApp()->m_templateList;
00579 ERROR3IF(templateList.GetCount() > 1, "Too many doc templates in LoadAppWindowState");
00580 CDocTemplate* pTemplate = (CDocTemplate*) templateList.GetHead();
00581 #else
00582
00583 POSITION Pos = AfxGetApp()->GetFirstDocTemplatePosition();
00584 CDocTemplate* pTemplate = AfxGetApp()->GetNextDocTemplate(Pos);
00585 #endif
00586 ERROR3IF(pTemplate == NULL, "No doc template in LoadAppWindowState");
00587 ERROR3IF(!pTemplate->IsKindOf(RUNTIME_CLASS(CDocTemplate)),
00588 "Not a doc template in LoadAppWindowsState");
00589
00590
00591 CCamDoc* pDoc;
00592 CCamMDIChild* pFrame;
00593 DWORD nViewCount = GetRegDword(hDocKey, TEXT("AttachedViewCount"));
00594 for (DWORD nView = 1; nView <= nViewCount; nView++)
00595 {
00596
00597
00598
00599 TCHAR szViewID[32];
00600 ::wsprintf(szViewID, TEXT("View %lu"), nView);
00601 HKEY hViewKey = OpenRegKey(hDocKey, szViewID);
00602 if (hViewKey == NULL)
00603 {
00604 TRACEUSER( "JustinF", _T("\tCan't find %s sub-key in LoadAppWindowState\n"),
00605 (LPCTSTR) szViewID);
00606 continue;
00607 }
00608
00609
00610 BOOL fHadFocus;
00611 ViewState* pvs = MakeViewStateFromKey(hViewKey, &fHadFocus);
00612 if (pvs == NULL)
00613 {
00614 delete[] pzOrder;
00615
00616 CloseRegKey(hViewKey);
00617 CloseRegKey(hMDIKey);
00618 CloseRegKey(hWorkspaceKey);
00619
00620 StatusLine::SetDefaultPrefix();
00621 fDontMaximiseViews = FALSE;
00622 ERROR(_R(IDE_NOMORE_MEMORY), FALSE);
00623 }
00624
00625
00626 DeleteRegKey(hDocKey, szViewID);
00627
00628
00629
00630 INT32 zPos = pvs->zPos;
00631
00632
00633 ScreenCamView::SetReadyMadeViewState(pvs);
00634
00635
00636
00637 if (nView == 1)
00638 {
00639
00640 Document::ShouldRestoreViewOnImport(FALSE);
00641
00642
00643 if (strPath.IsEmpty())
00644 {
00645
00646
00647 pDoc = (CCamDoc*) pTemplate->OpenDocumentFile(NULL);
00648 }
00649 else
00650 {
00651
00652 pDoc = (CCamDoc*) AfxGetApp()->OpenDocumentFile(strPath);
00653 ((CCamApp*) AfxGetApp())->MakeDocumentNative(pDoc, &PathName(strPath));
00654 }
00655
00656
00657 Document::ShouldRestoreViewOnImport(TRUE);
00658
00659
00660 if (pDoc != NULL)
00661 {
00662
00663 POSITION pos = pDoc->GetFirstViewPosition();
00664 pFrame = (CCamMDIChild*) (pDoc->GetNextView(pos)->GetParentFrame());
00665 pFrame->MDIActivate();
00666
00667
00668 fAtLeastOneLoaded = TRUE;
00669 pDoc->SetOriginalPath(strPath);
00670
00671
00672
00673 }
00674 else
00675 {
00676
00677 TRACEUSER( "JustinF", _T("\t\tFailed to create doc %lu in LoadAppWindowState\n"),
00678 (UINT32) nDoc);
00679 ScreenCamView::SetReadyMadeViewState(NULL);
00680 delete pvs;
00681 break;
00682 }
00683 }
00684 else
00685 {
00686
00687 pFrame = (CCamMDIChild*) pTemplate->CreateNewFrame(pDoc, pFrame);
00688 if (pFrame == NULL)
00689 {
00690 TRACEUSER( "JustinF", _T("\t\tCouldn't create frame in LoadAppWindowState\n"));
00691 continue;
00692 }
00693
00694
00695 pTemplate->InitialUpdateFrame(pFrame, pDoc, TRUE);
00696 pFrame->MDIActivate();
00697 }
00698
00699
00700 if (pSplashBox != NULL) pSplashBox->SetActiveWindow();
00701
00702
00703 ERROR3IF(zPos >= nTotalViews, "Out of range zPos in LoadAppWindowState");
00704 if (zPos < nTotalViews) pzOrder[zPos] = pFrame;
00705 if (fHadFocus) pFocusFrame = pFrame;
00706
00707
00708
00709
00710 if (nViewCount == 1)
00711 {
00712 pFrame->m_nWindow = 0;
00713 }
00714 else
00715 {
00716 TCHAR szTitle[_MAX_PATH + 32], szNewTitle[_MAX_PATH + 32];
00717 pFrame->GetWindowText(szTitle, sizeof(szTitle) / sizeof(szTitle[0]));
00718 ::wsprintf(szNewTitle, TEXT("%s:%lu"), (LPCTSTR) szTitle, (UINT32) nView);
00719 pFrame->SetWindowText(szNewTitle);
00720 pFrame->m_nWindow = nView;
00721 }
00722 }
00723
00724
00725 CloseRegKey(hDocKey);
00726 DeleteRegKey(hMDIKey, szDocID);
00727 }
00728
00729
00730 fDontMaximiseViews = FALSE;
00731
00732
00733 if (!fAtLeastOneLoaded)
00734 {
00735 TRACEUSER( "JustinF", _T("Couldn't restore even one doc - wiping MDI key\n"));
00736 DeleteRegKey(hWorkspaceKey, TEXT("MDI"));
00737 CloseRegKey(hWorkspaceKey);
00738 delete[] pzOrder;
00739
00740 StatusLine::SetDefaultPrefix();
00741 return FALSE;
00742 }
00743
00744
00745 CloseRegKey(hMDIKey);
00746 CloseRegKey(hWorkspaceKey);
00747
00748
00749
00750
00751 CWnd* pwndLast = (CWnd*) &CWnd::wndTop;
00752 for (INT32 i = 0; i < nTotalViews; i++)
00753 {
00754 CCamMDIChild* pFrame = pzOrder[i];
00755 if (pFrame != NULL)
00756 {
00757
00758 pFrame->SetWindowPos(pwndLast, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
00759 pwndLast = pFrame;
00760 }
00761 }
00762
00763
00764
00765
00766 if (pFocusFrame != NULL) pFocusFrame->MDIActivate();
00767
00768
00769 delete[] pzOrder;
00770 StatusLine::SetDefaultPrefix();
00771 return TRUE;
00772 }
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786 BOOL InitAppState()
00787 {
00788
00789 ERROR2IF(!GetApplication()->DeclareSection(TEXT("Workspace"), 5) ||
00790 !GetApplication()->DeclarePref(TEXT("Workspace"), TEXT("RestoreOnStartup"),
00791 &fRestoreWorkspaceOnStartup, FALSE, TRUE),
00792 FALSE,
00793 _R(IDE_BAD_INI_FILE));
00794
00795
00796
00797
00798
00799 return TRUE;
00800 }