共用方式為


CWinAppEx::StoreWindowPlacement

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

virtual BOOL StoreWindowPlacement(
   const CRect& rectNormalPosition,
   int nFlags,
   int nShowCmd 
);

Parameters

  • [in] nFlags
    Flags that control the position of the minimized window and how the operating system switches between a minimized window and a restored window.

  • [in] nShowCmd
    An integer that specifies the show state of the window. For more information about possible values, see CWnd::ShowWindow.

  • [in] rectNormalPosition
    A rectangle that contains the coordinates of the main frame window when it is in the restored state.

Return Value

Nonzero if successful; 0 otherwise.

Remarks

By default, MFC automatically saves the position and state of the main frame window before the application exits. This information is stored in the Windows registry under the WindowPlacement key in the default registry location for your application. For more information about the default registry location of your application, see CWinAppEx::GetRegistryBase.

Override this method if you want to store additional information about the main frame window.

Requirements

Header: afxwinappex.h

See Also

Reference

CWinAppEx Class

Hierarchy Chart

CWinAppEx::LoadWindowPlacement