[!if RIBBON_TOOLBAR] // This MFC Samples source code demonstrates using MFC Microsoft Office Fluent User Interface // (the "Fluent UI") and is provided only as referential material to supplement the // Microsoft Foundation Classes Reference and related electronic documentation // included with the MFC C++ library software. // License terms to copy, use or distribute the Fluent UI are available separately. // To learn more about our Fluent UI licensing program, please visit // https://go.microsoft.com/fwlink/?LinkId=238214. // // Copyright (C) Microsoft Corporation // All rights reserved. [!endif] // $appimpl$ : Defines the class behaviors for the application. // #include "pch.h" #include "framework.h" #include "afxwinappex.h" #include "afxdialogex.h" #include "$appheader$" #include "$mainframeheader$" [!if APP_TYPE_MDI] #include "$childframeheader$" [!endif] [!if MINI_SERVER || FULL_SERVER || CONTAINER_SERVER] #include "$inplaceframeheader$" [!endif] [!if OLEDB_RECORD_VIEW || ODBC_RECORD_VIEW] #include "$rowsetheader$" [!endif] [!if DOCVIEW] #include "$docheader$" [!if PROJECT_STYLE_EXPLORER] #include "$treeviewheader$" [!else] #include "$viewheader$" [!endif] [!endif] #ifdef _DEBUG #define new DEBUG_NEW #endif // $appclass$ BEGIN_MESSAGE_MAP($appclass$, $appbaseclass$) ON_COMMAND(ID_APP_ABOUT, &$appclass$::OnAppAbout) [!if APP_TYPE_MTLD] ON_COMMAND(ID_FILE_NEW_FRAME, &$appclass$::OnFileNewFrame) [!if DOCVIEW] ON_COMMAND(ID_FILE_NEW, &$appclass$::OnFileNew) [!endif] [!endif] [!if !DOCVIEW] [!if APP_TYPE_MDI] ON_COMMAND(ID_FILE_NEW, &$appclass$::OnFileNew) [!endif] [!endif] [!if DOCVIEW] [!if !DB_VIEW_NO_FILE] // Standard file based document commands [!if !APP_TYPE_MTLD] ON_COMMAND(ID_FILE_NEW, &$appbaseclass$::OnFileNew) [!endif] ON_COMMAND(ID_FILE_OPEN, &$appbaseclass$::OnFileOpen) [!endif] [!endif] [!if PRINTING && DOCVIEW] // Standard print setup command ON_COMMAND(ID_FILE_PRINT_SETUP, &$appbaseclass$::OnFilePrintSetup) [!endif] END_MESSAGE_MAP() // $appclass$ construction $appclass$::$appclass$() noexcept { [!if MENUBAR_TOOLBAR || ADV_DOCKING_EXPLORER || ADV_DOCKING_OUTPUT || ADV_DOCKING_PROPERTIES || ADV_DOCKING_NAVIGATION] m_bHiColorIcons = TRUE; [!endif] [!if MENUBAR_TOOLBAR || RIBBON_TOOLBAR] [!if ENABLE_VISUAL_STYLE_SWITCHING] m_nAppLook = 0; [!endif] [!endif] [!if RESTART_MGR_SUPPORT] // support Restart Manager [!if !RESTART_MGR_SUPPORT_RESTART && !RESTART_MGR_SUPPORT_RECOVERY] m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART; [!endif] [!if RESTART_MGR_SUPPORT_RESTART && !RESTART_MGR_SUPPORT_RECOVERY] m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART_ASPECTS; [!endif] [!if RESTART_MGR_SUPPORT_RECOVERY && !RESTART_MGR_SUPPORT_RESTART] m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RECOVERY_ASPECTS; [!endif] [!if RESTART_MGR_SUPPORT_RECOVERY && RESTART_MGR_SUPPORT_RESTART] m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_ALL_ASPECTS; [!endif] #ifdef _MANAGED // If the application is built using Common Language Runtime support (/clr): // 1) This additional setting is needed for Restart Manager support to work properly. // 2) In your project, you must add a reference to System.Windows.Forms in order to build. System::Windows::Forms::Application::SetUnhandledExceptionMode(System::Windows::Forms::UnhandledExceptionMode::ThrowException); #endif [!endif] // TODO: replace application ID string below with unique ID string; recommended // format for string is CompanyName.ProductName.SubProduct.VersionInformation SetAppID(_T("$safeprojectname$.AppID.NoVersion")); // TODO: add construction code here, // Place all significant initialization in InitInstance } [!if ATL_SUPPORT] // ATL Module object CComModule _Module; [!endif] // The one and only $appclass$ object $appclass$ theApp; [!if MINI_SERVER || FULL_SERVER || CONTAINER_SERVER || AUTOMATION] // This identifier was generated to be statistically unique for your app // You may change it if you prefer to choose a specific identifier // {$guid_app_clsid$} static const CLSID clsid = $guid_app_clsid_staticconst$; [!endif] [!if AUTOMATION] const GUID CDECL _tlid = $guid_lib_id_staticconst$; const WORD _wVerMajor = 1; const WORD _wVerMinor = 0; [!endif] // $appclass$ initialization BOOL $appclass$::InitInstance() { [!if MANIFEST] // InitCommonControlsEx() is required on Windows XP if an application // manifest specifies use of ComCtl32.dll version 6 or later to enable // visual styles. Otherwise, any window creation will fail. INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); // Set this to include all the common control classes you want to use // in your application. InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); [!endif] $appbaseclass$::InitInstance(); [!if OLEDB] CoInitialize(nullptr); [!endif] [!if SOCKETS] if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } [!endif] [!if CONTAINER || MINI_SERVER || FULL_SERVER || CONTAINER_SERVER || AUTOMATION || OLEDB || ACTIVEX_CONTROLS || ACCESSIBILITY || RIBBON_TOOLBAR] // Initialize OLE libraries if (!AfxOleInit()) { AfxMessageBox(IDP_OLE_INIT_FAILED); return FALSE; } [!endif] [!if ACTIVEX_CONTROLS] AfxEnableControlContainer(); [!endif] [!if APP_TYPE_MDI && APP_TYPE_TABBED_MDI] EnableTaskbarInteraction(); [!else] EnableTaskbarInteraction(FALSE); [!endif] // AfxInitRichEdit2() is required to use RichEdit control // AfxInitRichEdit2(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need // Change the registry key under which our settings are stored // TODO: You should modify this string to be something appropriate // such as the name of your company or organization SetRegistryKey(_T("Local AppWizard-Generated Applications")); [!if DOCVIEW] LoadStdProfileSettings($mrusize$); // Load standard INI file options (including MRU) [!endif] [!if MENUBAR_TOOLBAR || RIBBON_TOOLBAR] InitContextMenuManager(); [!if ADV_DOCKING_NAVIGATION] InitShellManager(); [!endif] InitKeyboardManager(); InitTooltipManager(); CMFCToolTipInfo ttParams; ttParams.m_bVislManagerTheme = TRUE; theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL, RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams); [!endif] [!if !DOCVIEW] // To create the main window, this code creates a new frame window // object and then sets it as the application's main window object [!if APP_TYPE_MDI] CMDIFrameWnd* pFrame = new $mainframeclass$; [!else] [!if !DOCVIEW] CFrameWnd* pFrame = new $mainframeclass$; [!else] CRuntimeClass* pClass = RUNTIME_CLASS($mainframeclass$); CFrameWnd* pFrame = (CFrameWnd*) pClass->CreateObject(); ASSERT_KINDOF(CFrameWnd, pFrame); [!endif] [!endif] if (!pFrame) return FALSE; m_pMainWnd = pFrame; [!if APP_TYPE_SDI] [!if DOCVIEW] // load the frame against an empty context CCreateContext context; [!else] // create and load the frame with its resources [!endif] pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, nullptr, [!if DOCVIEW] &context); [!else] nullptr); [!endif] [!else] // create main MDI frame window if (!pFrame->LoadFrame(IDR_MAINFRAME)) return FALSE; // try to load shared MDI menus and accelerator table //TODO: add additional member variables and load calls for // additional menu types your application may need HINSTANCE hInst = AfxGetResourceHandle(); m_hMDIMenu = ::LoadMenu(hInst, MAKEINTRESOURCE(IDR_$safedoctypename$TYPE)); m_hMDIAccel = ::LoadAccelerators(hInst, MAKEINTRESOURCE(IDR_$safedoctypename$TYPE)); [!endif] [!else] // Register the application's document templates. Document templates // serve as the connection between documents, frame windows and views [!if APP_TYPE_MDI] CMultiDocTemplate* pDocTemplate; pDocTemplate = new CMultiDocTemplate(IDR_$safedoctypename$TYPE, [!else] [!if APP_TYPE_MTLD] CMultiDocTemplate* pDocTemplate; pDocTemplate = new CMultiDocTemplate( IDR_MAINFRAME, [!else] CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, [!endif] [!endif] RUNTIME_CLASS($docclass$), [!if APP_TYPE_MDI] RUNTIME_CLASS($childframeclass$), // custom MDI child frame [!else] RUNTIME_CLASS($mainframeclass$), // main SDI frame window [!endif] [!if PROJECT_STYLE_EXPLORER] RUNTIME_CLASS($treeviewclass$)); [!else] RUNTIME_CLASS($viewclass$)); [!endif] if (!pDocTemplate) return FALSE; [!if CONTAINER || CONTAINER_SERVER] [!if APP_TYPE_MDI] pDocTemplate->SetContainerInfo(IDR_$safedoctypename$TYPE_CNTR_IP); [!else] pDocTemplate->SetContainerInfo(IDR_CNTR_INPLACE); [!endif] [!endif] [!if MINI_SERVER || FULL_SERVER || CONTAINER_SERVER] pDocTemplate->SetServerInfo( [!if APP_TYPE_MDI] IDR_$safedoctypename$TYPE_SRVR_EMB, IDR_$safedoctypename$TYPE_SRVR_IP, [!else] IDR_SRVR_EMBEDDED, IDR_SRVR_INPLACE, [!endif] RUNTIME_CLASS($inplaceframeclass$)); [!endif] [!if APP_TYPE_MTLD] m_pDocTemplate = pDocTemplate; [!endif] AddDocTemplate(pDocTemplate); [!if MINI_SERVER || FULL_SERVER || CONTAINER_SERVER || AUTOMATION] // Connect the COleTemplateServer to the document template // The COleTemplateServer creates new documents on behalf // of requesting OLE containers by using information // specified in the document template [!if APP_TYPE_MDI || APP_TYPE_MTLD] m_server.ConnectTemplate(clsid, pDocTemplate, FALSE); // Register all OLE server factories as running. This enables the // OLE libraries to create objects from other applications COleTemplateServer::RegisterAll(); // Note: MDI applications register all server objects without regard // to the /Embedding or /Automation on the command line [!else] m_server.ConnectTemplate(clsid, pDocTemplate, TRUE); // Note: SDI applications register server objects only if /Embedding // or /Automation is present on the command line [!endif] [!endif] [!endif] [!if APP_TYPE_MDI && DOCVIEW] // create main MDI Frame window $mainframeclass$* pMainFrame = new $mainframeclass$; if (!pMainFrame || !pMainFrame->LoadFrame(IDR_MAINFRAME)) { delete pMainFrame; return FALSE; } m_pMainWnd = pMainFrame; [!if !MINI_SERVER] [!if HAS_SUFFIX && !HTML_EDITVIEW] // call DragAcceptFiles only if there's a suffix // In an MDI app, this should occur immediately after setting m_pMainWnd // Enable drag/drop open m_pMainWnd->DragAcceptFiles(); [!endif] [!endif] [!endif] [!if TOOLBAR_EXTCHAR_TRANSLATE] // Allow extended characters as menu accelerators CMFCToolBar::m_bExtCharTranslation = TRUE; [!endif] [!if DOCVIEW] // Parse command line for standard shell commands, DDE, file open CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); [!endif] [!if !MINI_SERVER] [!if HAS_SUFFIX && !HTML_EDITVIEW] // Enable DDE Execute open EnableShellOpen(); RegisterShellFileTypes(TRUE); [!endif] [!endif] [!if MINI_SERVER || FULL_SERVER || CONTAINER_SERVER || AUTOMATION] // App was launched with /Embedding or /Automation switch. // Run app as automation server. if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated) { [!if !APP_TYPE_MDI && !APP_TYPE_MTLD] // Register all OLE server factories as running. This enables the // OLE libraries to create objects from other applications COleTemplateServer::RegisterAll(); [!endif] // Don't show the main window return TRUE; } // App was launched with /Unregserver or /Unregister switch. Unregister // typelibrary. Other unregistration occurs in ProcessShellCommand(). else if (cmdInfo.m_nShellCommand == CCommandLineInfo::AppUnregister) { [!if !MINI_SERVER] [!if HAS_SUFFIX && !HTML_EDITVIEW] UnregisterShellFileTypes(); [!endif] [!endif] [!if MINI_SERVER || FULL_SERVER || CONTAINER_SERVER] [!if ACTIVE_DOC_SERVER] m_server.UpdateRegistry(OAT_DOC_OBJECT_SERVER, nullptr, nullptr, FALSE); [!else] m_server.UpdateRegistry(OAT_INPLACE_SERVER, nullptr, nullptr, FALSE); [!endif] [!else] [!if AUTOMATION] m_server.UpdateRegistry(OAT_DISPATCH_OBJECT, nullptr, nullptr, FALSE); [!endif] [!endif] [!if AUTOMATION] AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor); [!endif] [!if MINI_SERVER] return FALSE; [!endif] } // App was launched standalone or with other switches (e.g. /Register // or /Regserver). Update registry entries, including typelibrary. else { [!if MINI_SERVER || FULL_SERVER || CONTAINER_SERVER] [!if ACTIVE_DOC_SERVER] m_server.UpdateRegistry(OAT_DOC_OBJECT_SERVER); [!else] m_server.UpdateRegistry(OAT_INPLACE_SERVER); [!endif] [!else] [!if AUTOMATION] m_server.UpdateRegistry(OAT_DISPATCH_OBJECT); [!endif] [!endif] [!if AUTOMATION] COleObjectFactory::UpdateRegistryAll(); AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid); [!endif] [!if MINI_SERVER] if (cmdInfo.m_nShellCommand == CCommandLineInfo::AppRegister) return FALSE; [!endif] } [!endif] [!if MINI_SERVER] // When a mini-server is run stand-alone the registry is updated and the // user is instructed to use the Insert Object dialog in a container // to use the server. Mini-servers do not have stand-alone user interfaces AfxMessageBox(IDP_USE_INSERT_OBJECT); return FALSE; [!else] [!if DOCVIEW] // Dispatch commands specified on the command line. Will return FALSE if // app was launched with /RegServer, /Register, /Unregserver or /Unregister. if (!ProcessShellCommand(cmdInfo)) return FALSE; [!endif] [!if APP_TYPE_MDI] // The main window has been initialized, so show and update it [!if DOCVIEW] [!if MAIN_FRAME_MAXIMIZED] pMainFrame->ShowWindow(SW_SHOWMAXIMIZED); [!else] [!if MAIN_FRAME_MINIMIZED] pMainFrame->ShowWindow(SW_SHOWMINIMIZED); [!else] [!if APP_TYPE_SDI || APP_TYPE_MTLD] pMainFrame->ShowWindow(SW_SHOW); [!else] pMainFrame->ShowWindow(m_nCmdShow); [!endif] [!endif] [!endif] pMainFrame->UpdateWindow(); [!else] [!if MAIN_FRAME_MAXIMIZED] pFrame->ShowWindow(SW_SHOWMAXIMIZED); [!else] [!if MAIN_FRAME_MINIMIZED] pFrame->ShowWindow(SW_SHOWMINIMIZED); [!else] [!if APP_TYPE_SDI || APP_TYPE_MTLD] pFrame->ShowWindow(SW_SHOW); [!else] pFrame->ShowWindow(m_nCmdShow); [!endif] [!endif] [!endif] pFrame->UpdateWindow(); [!endif] [!endif] [!if APP_TYPE_SDI || APP_TYPE_MTLD] // The one and only window has been initialized, so show and update it [!if DOCVIEW] [!if MAIN_FRAME_MAXIMIZED] m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED); [!else] [!if MAIN_FRAME_MINIMIZED] m_pMainWnd->ShowWindow(SW_SHOWMINIMIZED); [!else] [!if APP_TYPE_SDI || APP_TYPE_MTLD] m_pMainWnd->ShowWindow(SW_SHOW); [!else] m_pMainWnd->ShowWindow(m_nCmdShow); [!endif] [!endif] [!endif] m_pMainWnd->UpdateWindow(); [!else] [!if MAIN_FRAME_MAXIMIZED] pFrame->ShowWindow(SW_SHOWMAXIMIZED); [!else] [!if MAIN_FRAME_MINIMIZED] pFrame->ShowWindow(SW_SHOWMINIMIZED); [!else] [!if APP_TYPE_SDI || APP_TYPE_MTLD] pFrame->ShowWindow(SW_SHOW); [!else] pFrame->ShowWindow(m_nCmdShow); [!endif] [!endif] [!endif] pFrame->UpdateWindow(); [!endif] [!if HAS_SUFFIX && !HTML_EDITVIEW] // call DragAcceptFiles only if there's a suffix // In an SDI app, this should occur after ProcessShellCommand // Enable drag/drop open m_pMainWnd->DragAcceptFiles(); [!endif] [!endif] return TRUE; [!endif] } [!if CONTAINER || MINI_SERVER || FULL_SERVER || CONTAINER_SERVER || AUTOMATION || OLEDB || ACTIVEX_CONTROLS || ACCESSIBILITY || RIBBON_TOOLBAR || APP_TYPE_MDI || !DOCVIEW] int $appclass$::ExitInstance() { //TODO: handle additional resources you may have added [!if APP_TYPE_MDI] [!if !DOCVIEW] if (m_hMDIMenu != nullptr) FreeResource(m_hMDIMenu); if (m_hMDIAccel != nullptr) FreeResource(m_hMDIAccel); [!endif] [!endif] [!if CONTAINER || MINI_SERVER || FULL_SERVER || CONTAINER_SERVER || AUTOMATION || OLEDB || ACTIVEX_CONTROLS || ACCESSIBILITY || RIBBON_TOOLBAR] AfxOleTerm(FALSE); [!endif] [!if OLEDB] CoUninitialize(); [!endif] return $appbaseclass$::ExitInstance(); } [!endif] // $appclass$ message handlers [!if !DOCVIEW] [!if APP_TYPE_MDI] void $appclass$::OnFileNew() { [!if APP_TYPE_SDI] CString strUntitled; CFrameWnd* pFrameWnd = DYNAMIC_DOWNCAST(CFrameWnd, m_pMainWnd); if (pFrameWnd != nullptr) { //TODO: close and destroy any file-specific data you've got // in memory. Once done, execute the following if statement // to reset the title of the frame window if (strUntitled.LoadString(AFX_IDS_UNTITLED)) pFrameWnd->UpdateFrameTitleForDocument(strUntitled); else pFrameWnd->UpdateFrameTitleForDocument(nullptr); } [!else] $mainframeclass$* pFrame = STATIC_DOWNCAST($mainframeclass$, m_pMainWnd); [!if APP_TYPE_TABBED_MDI] pFrame->LockWindowUpdate(); [!endif] // create a new MDI child window pFrame->CreateNewChild( RUNTIME_CLASS(CChildFrame), IDR_$safedoctypename$TYPE, m_hMDIMenu, m_hMDIAccel); [!if APP_TYPE_TABBED_MDI] pFrame->UnlockWindowUpdate(); [!endif] [!endif] } [!endif] [!endif] // CAboutDlg dialog used for App About class CAboutDlg : public CDialogEx { public: CAboutDlg() noexcept; // Dialog Data #ifdef AFX_DESIGN_TIME enum { IDD = IDD_ABOUTBOX }; #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support // Implementation protected: DECLARE_MESSAGE_MAP() }; CAboutDlg::CAboutDlg() noexcept : CDialogEx(IDD_ABOUTBOX) { [!if ACCESSIBILITY] EnableActiveAccessibility(); [!endif] } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx) END_MESSAGE_MAP() // App command to run the dialog void $appclass$::OnAppAbout() { CAboutDlg aboutDlg; aboutDlg.DoModal(); } [!if MENUBAR_TOOLBAR || RIBBON_TOOLBAR] // $appclass$ customization load/save methods void $appclass$::PreLoadState() { BOOL bNameValid; CString strName; bNameValid = strName.LoadString(IDS_EDIT_MENU); ASSERT(bNameValid); GetContextMenuManager()->AddMenu(strName, IDR_POPUP_EDIT); [!if ADV_DOCKING_EXPLORER] bNameValid = strName.LoadString(IDS_EXPLORER); ASSERT(bNameValid); GetContextMenuManager()->AddMenu(strName, IDR_POPUP_EXPLORER); [!endif] } void $appclass$::LoadCustomState() { } void $appclass$::SaveCustomState() { } [!endif] // $appclass$ message handlers [!if APP_TYPE_MTLD] [!if DOCVIEW] void $appclass$::OnFileNewFrame() { ASSERT(m_pDocTemplate != nullptr); CDocument* pDoc = nullptr; CFrameWnd* pFrame = nullptr; // Create a new instance of the document referenced // by the m_pDocTemplate member. if (m_pDocTemplate != nullptr) pDoc = m_pDocTemplate->CreateNewDocument(); if (pDoc != nullptr) { // If creation worked, use create a new frame for // that document. pFrame = m_pDocTemplate->CreateNewFrame(pDoc, nullptr); if (pFrame != nullptr) { // Set the title, and initialize the document. // If document initialization fails, clean-up // the frame window and document. m_pDocTemplate->SetDefaultTitle(pDoc); if (!pDoc->OnNewDocument()) { pFrame->DestroyWindow(); pFrame = nullptr; } else { // Otherwise, update the frame m_pDocTemplate->InitialUpdateFrame(pFrame, pDoc, TRUE); } } } // If we failed, clean up the document and show a // message to the user. if (pFrame == nullptr || pDoc == nullptr) { delete pDoc; AfxMessageBox(AFX_IDP_FAILED_TO_CREATE_DOC); } } void $appclass$::OnFileNew() { CDocument* pDoc = nullptr; CFrameWnd* pFrame; pFrame = DYNAMIC_DOWNCAST(CFrameWnd, CWnd::GetActiveWindow()); if (pFrame != nullptr) pDoc = pFrame->GetActiveDocument(); if (pFrame == nullptr || pDoc == nullptr) { // if it's the first document, create as normal CWinApp::OnFileNew(); } else { // Otherwise, see if we have to save modified, then // ask the document to reinitialize itself. if (!pDoc->SaveModified()) return; CDocTemplate* pTemplate = pDoc->GetDocTemplate(); ASSERT(pTemplate != nullptr); if (pTemplate != nullptr) pTemplate->SetDefaultTitle(pDoc); pDoc->OnNewDocument(); } } [!else] void $appclass$::OnFileNewFrame() { CFrameWnd* pFrame = new $mainframeclass$; pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, nullptr, nullptr); pFrame->ShowWindow(SW_SHOW); pFrame->UpdateWindow(); m_aryFrames.Add(pFrame->GetSafeHwnd()); } [!endif] [!endif]