Partager via


CWinAppEx::SaveState

Writes the application state to the Windows registry.

virtual BOOL SaveState(
   LPCTSTR lpszSectionName = NULL,
   CFrameImpl* pFrameImpl = NULL 
);
BOOL SaveState(
   CMDIFrameWndEx* pFrame,
   LPCTSTR lpszSectionName = NULL 
);
BOOL SaveState(
   CFrameWndEx* pFrame,
   LPCTSTR lpszSectionName = NULL 
);
BOOL SaveState(
   COleIPFrameWndEx* pFrame,
   LPCTSTR lpszSectionName = NULL 
);

Parameters

  • [in] lpszSectionName
    A string that contains the relative path of a registry key.

  • [in] pFrameImpl
    A pointer to a CFrameImpl object. This frame is saved to the Windows registry.

  • [in] pFrame
    A pointer to a frame window object. This frame is saved to the Windows registry.

Return Value

True if successful; false otherwise.

Remarks

This method saves the state of the application and any state information for the provided frame window. If you do not provide a frame window, the method only saves the application state. The application information includes the state of the CMouseManager Class, CContextMenuManager Class, CKeyboardManager Class, and the CUserToolsManager Class.

The lpszSectionName parameter is not the absolute path for a registry entry. It is a relative path that is appended to the end of the default registry key for your application. To get or set the default registry key, use the methods CWinAppEx::GetRegistryBase and CWinAppEx::SetRegistryBase respectively.

Requirements

Header: afxwinappex.h

See Also

Reference

CWinAppEx Class

Hierarchy Chart

CWinAppEx::LoadState