MFC intercepted maximize, minimize the message, cancel Esc and Enter exit to exit

Maximize and minimize invalid dialog box, the Esc and Enter exit to exit invalid.

void CtestDialogDlg :: OnSysCommand, (UINT nID, LPARAM lParam),
{
    // the TODO: this addition message handler code, and / or invoke the default value 
    IF (== SC_MAXIMIZE the nID)
         return ;
     IF (== SC_MINIMIZE the nID)
    {
        return;
    }
    if (SC_CLOSE == nID)
    {
        //CDialogEx::OnClose();
        CDialogEx::OnCancel();
    }
    TRACE0("OnSysCommand()\n");

    CDialogEx :: OnSysCommand (nID, lParam);
}


void CtestDialogDlg :: OnOK ()
{
    // the TODO: add this special code and / or call the base class

//     CDialogEx :: OnOK (); 
}


void CtestDialogDlg OnCancel ()
{
    // the TODO: add this special code and / or call the base class

//     CDialogEx OnCancel (); 
}
View Code

 

Guess you like

Origin www.cnblogs.com/htj10/p/11862598.html