다음을 통해 공유


CWinAppEx::LoadState

Reads the application state from the Windows registry.

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

Parameters

  • [in] pFrame
    A pointer to a frame window object. The method applies the state information in the registry to this frame window.

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

  • [in] pFrameImpl
    A pointer to a CFrameImpl object. The method applies the state information in the registry to this frame window.

Return Value

Nonzero if successful; 0 otherwise.

Remarks

This method loads the state of the application and any state information for a frame window. The loaded information for the frame window is applied to the supplied frame window. If you do not supply a frame window, only the application state information is loaded. The application information includes the state of the CMouseManager Class, CContextMenuManager Class, CKeyboardManager Class, and the CUserToolsManager Class.

The default implementation of CFrameImpl::OnLoadFrame calls LoadState.

The lpszSectionName parameter is not the absolute path for a registry entry. It is a relative path that is added 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::SaveState