Partager via


CDialogEx Class

The CDialogEx class specifies the background color and background image of a dialog box.

class CDialogEx : public CDialog

Members

Public Constructors

Name

Description

CDialogEx::CDialogEx

Constructs a CDialogEx object.

CDialogEx::~CDialogEx

Destructor.

Public Methods

Name

Description

CDialogEx::GetThisClass

Used by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type.

CDialogEx::PreTranslateMessage

Translates window messages before they are dispatched to the TranslateMessage and DispatchMessage Windows functions. For more information and method syntax, see CWnd::PreTranslateMessage. (Overrides CDialog::PreTranslateMessage.)

CDialogEx::SetBackgroundColor

Sets the background color of the dialog box.

CDialogEx::SetBackgroundImage

Sets the background image of the dialog box.

Remarks

To use the CDialogEx class, derive your dialog box class from the CDialogEx class instead of the CDialog class.

Dialog box images are stored in a resource file. The framework automatically deletes any image that is loaded from the resource file. To programmatically delete the current background image, call the CDialogEx::SetBackgroundImage method or implement an OnDestroy event handler. When you call the CDialogEx::SetBackgroundImage method, pass in an HBITMAP parameter as the image handle. The CDialogEx object will take ownership of the image and delete it if the m_bAutoDestroyBmp flag is TRUE.

A CDialogEx object can be a parent of a CMFCPopupMenu Class object. The CMFCPopupMenu Class object calls the CDialogEx::SetActiveMenu method when the CMFCPopupMenu Class object opens. Afterward, the CDialogEx object handles any menu event until the CMFCPopupMenu Class object is closed.

Inheritance Hierarchy

CObject

   CCmdTarget

      CWnd

         CDialog

            CDialogEx

Requirements

Header: afxdialogex.h

See Also

Reference

Hierarchy Chart

CMFCPopupMenu Class

CContextMenuManager Class

Other Resources

MFC Classes