请问:一个应用程序被最小化的事件处理
当然也包括程序被激活的事件处理

解决方案 »

  1.   

    不太明白你的问题。
    若是简单的最小最大化,是WM_SYSCOMMAND消息
      

  2.   

    WM_SIZE
    void CXXXDlg::OnSize(UINT nType, int cx, int cy) 
    {
    CDialog::OnSize(nType, cx, cy);
    // TODO: Add your message handler code here
    if(nType == SIZE_MINIMIZED) AfxMessageBox("SIZE_MINIMIZED"); 
    }
      

  3.   

    程序激活的消息:WM_ACTIVATE
    映射此消息,如果消息的wParam为WA_ACTIVE则表示程序被激活。
      

  4.   

    引自msdn:CWnd::OnActivate
    afx_msg void OnActivate( UINT nState, CWnd* pWndOther, BOOL bMinimized );ParametersnStateSpecifies 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. 
    pWndOtherPointer to the CWnd being activated or deactivated. The pointer can be NULL, and it may be temporary.bMinimizedSpecifies 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.