Visual C++ and MFC Fundamentals Chapter 12: Dialog-Based Windows
- Click OK
- To prevent the floating window from being closed, in the Class View, click
CFloaterDlg to select it. In the Properties window, click the Messages button
- Click the arrow of the WM_CLOSE combo box and select the only item in the list
- When the user tries to close the window, we will hide it instead since the window
will be closed when the parent application closes. Therefore, implement the event as
follows:
void CFloaterDlg::OnClose()
{
// TODO: Add your message handler code here and/or call default
ShowWindow(FALSE);
CDialog::OnClose();
}
- Display the MainFrm.h header file and declare a CFloaterDlg variable named Floater
//
#pragma once
#include "FloaterDlg.h"
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// Attributes
public: