Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated


The framework calls this member function when a CWnd object is being activated or deactivated.

afx_msg void OnActivate(
   UINT nState,
   CWnd* pWndOther,
   BOOL bMinimized 



Specifies whether the CWnd is being activated or deactivated. It can be one of the following values:

  • WA_INACTIVE   The window is being deactivated.

  • WA_ACTIVE   The window is being activated through some method other than a mouse click (for example, by use of the keyboard interface to select the window).

  • WA_CLICKACTIVE   The window is being activated by a mouse click.


Pointer to the CWnd being activated or deactivated. The pointer can be NULL, and it may be temporary.


Specifies the minimized state of the CWnd being activated or deactivated. A value of TRUE indicates the window is minimized.

If TRUE, the CWnd is being activated; otherwise deactivated.

If the CWnd object is activated with a mouse click, it will also receive an OnMouseActivate member function call.


This member function is called by the framework to allow your application to handle a Windows message. The parameters passed to your function reflect the parameters received by the framework when the message was received. If you call the base-class implementation of this function, that implementation will use the parameters originally passed with the message and not the parameters you supply to the function.

© 2016 Microsoft