Udostępnij za pośrednictwem


CWinAppEx Class

CWinAppEx handles the application state, saves the state to the registry, loads the state from the registry, initializes application managers, and provides links to those same application managers.

class CWinAppEx : public CWinApp

Members

Public Constructors

Name

Description

CWinAppEx::CWinAppEx

Constructs a CWinAppEx object.

Public Methods

Name

Description

CWinAppEx::CleanState

Removes information about the application from the Windows registry.

CWinAppEx::EnableLoadWindowPlacement

Specifies whether the application will load the initial size and location of the main frame window from the registry.

CWinAppEx::EnableTearOffMenus

Enables tear-off menus for the application.

CWinAppEx::EnableUserTools

Enables the user to create custom menu commands in the application.

CWinAppEx::ExitInstance

Called by the framework from within the Run member function to exit this instance of the application. (Overrides CWinApp::ExitInstance.)

CWinAppEx::GetBinary

Reads binary data that is associated with the specified registry value.

CWinAppEx::GetContextMenuManager

Returns a pointer to the global CContextMenuManager object.

CWinAppEx::GetDataVersion

 

CWinAppEx::GetDataVersionMajor

Returns the major version of the application saved in the Windows registry.

CWinAppEx::GetDataVersionMinor

Returns the minor version of the application saved in the Windows registry.

CWinAppEx::GetInt

Reads numeric data that is associated with the specified value from the registry.

CWinAppEx::GetKeyboardManager

Returns a pointer to the global CKeyboardManager object.

CWinAppEx::GetMouseManager

Returns a pointer to the global CMouseManager object.

CWinAppEx::GetObject

Reads CObject-derived data that is associated with the specified value from the registry.

CWinAppEx::GetRegSectionPath

Returns a string that is the path of a registry key. This path concatenates the supplied relative path with the application path.

CWinAppEx::GetRegistryBase

Returns the registry path for the application.

CWinAppEx::GetSectionBinary

Reads binary data that is associated with the specified key and value from the registry.

CWinAppEx::GetSectionInt

Reads numeric data from the registry associated with the specified key and value.

CWinAppEx::GetSectionObject

Reads CObject data that is associated with the specified key and value from the registry.

CWinAppEx::GetSectionString

Reads string data that is associated with the specified key and value from the registry.

CWinAppEx::GetShellManager

Returns a pointer to the global CShellManager object.

CWinAppEx::GetString

Reads string data that is associated with the specified value from the registry.

CWinAppEx::GetTooltipManager

Returns a pointer to the global CTooltipManager object.

CWinAppEx::GetUserToolsManager

Returns a pointer to the global CUserToolsManager object.

CWinAppEx::InitContextMenuManager

Initializes the CContextMenuManager object.

CWinAppEx::InitKeyboardManager

Initializes the CKeyboardManager object.

CWinAppEx::InitMouseManager

Initializes the CMouseManager object.

CWinAppEx::InitShellManager

Initializes the CShellManager class

CWinAppEx::InitTooltipManager

Initializes the CTooltipManager class.

CWinAppEx::IsResourceSmartUpdate

 

CWinAppEx::IsStateExists

Indicates whether the specified key is in the registry.

CWinAppEx::LoadState

Loads the application state from the registry.

CWinAppEx::OnAppContextHelp

Called by the framework when the user requests context help for the Customization dialog box.

CWinAppEx::OnViewDoubleClick

Calls the user-defined command when the user double-clicks anywhere in the application.

CWinAppEx::OnWorkspaceIdle

 

CWinAppEx::SaveState

Writes the state of the application framework to the Windows registry.

CWinAppEx::SetRegistryBase

Sets the path of the default registry key. This key will serve as a root for all subsequent registry calls.

CWinAppEx::ShowPopupMenu

Displays a popup menu.

CWinAppEx::WriteBinary

Writes the binary data to the specified registry value.

CWinAppEx::WriteInt

Writes the numeric data to the specified registry value.

CWinAppEx::WriteObject

Writes data that is derived from the CObject Class to the specified registry value.

CWinAppEx::WriteSectionBinary

Writes the binary data to a value of the specified registry key.

CWinAppEx::WriteSectionInt

Writes the numeric data to a value of the specified registry key.

CWinAppEx::WriteSectionObject

Writes data derived from the CObject class to a value of the specified registry key.

CWinAppEx::WriteSectionString

Writes the string data to a value of the specified registry key.

CWinAppEx::WriteString

Writes the string data to the specified registry value.

Protected Methods

Name

Description

CWinAppEx::LoadCustomState

Called by the framework when the application state has been loaded.

CWinAppEx::LoadWindowPlacement

Called by the framework when it loads the size and location of your application from the registry. The loaded data includes the size and location of the main frame at the time your application last closed.

CWinAppEx::OnClosingMainFrame

Called by the framework when a main frame window is processing WM_CLOSE.

CWinAppEx::PreLoadState

Called by the framework immediately before the application state is loaded.

CWinAppEx::PreSaveState

Called by the framework immediately before the application state is saved.

CWinAppEx::ReloadWindowPlacement

Reloads the size and location of the supplied window from the registry

CWinAppEx::SaveCustomState

Called by the framework after it writes the application state to the registry.

CWinAppEx::StoreWindowPlacement

Called by the framework to write the size and location of the main frame to the registry.

Data Members

Name

Description

CWinAppEx::m_bForceImageReset

Specifies whether the framework will reset all toolbar images when the frame window that contains the toolbar is loaded.

Remarks

Much of the functionality provided by the MFC framework depends on the CWinAppEx class. You can incorporate the CWinAppEx class into your application in one of two ways:

  • Construct a CWinAppEx class in the main thread.

  • Derive the main application class from CWinAppEx.

After you incorporate CWinAppEx into your application, you can initialize any one of the application managers. Before you use an application manager, you must initialize it by calling the appropriate initialize method. To obtain a pointer to a specific manager, call the associated get method. The CWinAppEx class manages the following application managers: CMouseManager Class, CContextMenuManager Class, CKeyboardManager Class, CUserToolsManager Class, and CMenuTearOffManager Class.

Inheritance Hierarchy

CObject

   CCmdTarget

      CWinThread

         CWinApp

            CWinAppEx

Requirements

Header: afxwinappex.h

See Also

Reference

Hierarchy Chart

CWinApp Class

CMouseManager Class

CContextMenuManager Class

CKeyboardManager Class

CUserToolsManager Class

Other Resources

MFC Classes