????? C++ ??? ?? ???? ????? ????? ??? ??????????? ????? ?? ????? ???? ????

???? ?????? ???? ??????
???? ID: 222829 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
???:Microsoft Visual C++ .NET (2002) Microsoft .NET Framework ?????? ??? ?? ??? ?? ???????? ???? ?? ????????? ??? Microsoft Windows ??? ???? ?? ?????? ???? ??? ?? ???? ??? ?? ?? ??????? ???? ????????? ????? C++ ??? ?? ??? ???? ???? ???
??? ?? ??????? ???? | ??? ?? ??????? ????

??????

??????????? ????? Windows ????????? ?? ??????? ?????????? ??????? ?????? ???; ?????, ????? ????? ?????? ???? ????????? ?? ??? ??? ?? ???? ??????????? ????? ??????????? ?? ???? ????? ????? ??? ?????? ?? ??? ???? ?????? ???

???? ???????

???????? accelerators ?? ??????? ????????? ?? ????? ????? ??? ??? TranslateAccelerator() ?????? ?? ??? ?? ??? ???? ???????, ?? ???? ????? ????? ?? ??? ????? ????? ??????? ????? ??? (Windows ??? ?????) ????? ??? ?? ?? ?????? ???? ?? ????? ?????? ?????? ??, ?? ????? ??? accelerators ????????? ???? ?? ??? ??????? ???? ???? ??? ??, ??????? ??? ???? ??? TranslateAccelerator() ????????

?? ???? ????? ????? ??? ??????????? ????? ?? ??????? ???? ?? ??? ?? ????? ????? PreTranslateMessage() ??????? ?????? ??? ?? ??? ?????? ?? ??????????? ?? ??? ??? ????? ?? ??????? ???? ?? ?????? ????: TranslateAccelerator(). ??? ?? ???? ???? ???? ??, ???? ???? PreTranslateMessage() ??? ?? ??? ???? ??????? ?????

?? ???? ?? ????????? ?? ??? ?? ????? ??????????? ????? ??????????? MFC MDI ????????? ?? AboutBox ????? ????? ?? ???:
  1. ??? ??? MFC MDI ????????? ??????? ??? ??????
  2. ????? ????? AboutBox ?????? ?? ??? ?????? ID "IDC_BUTTON1", ?? ???, ?? ??? ???????
  3. ?? ??? ?? ??? ??? ?????? ?????? ?? ??????????? ????? ??? ???? ?? ?? ???? ???? ?? ??? ??? ????? ??? ???????? ???? ??? ?? ???-????? ????:
    AfxMessageBox("Hello");
  4. ?????? ?? ??? ?? ??? ??????????? ?????? ???????? ?????
  5. ??????????? ????? ???? ?????? ?? ??? F5 ?????? ?????? ????? "IDC_BUTTON1" ?????? ID ?? ??? ??????
  6. ???? ?? ????? ??, m_hAccelTable, ?????? CAboutBox:
    HACCEL  m_hAccelTable;
  7. M_hAccelTable CAboutBox::CAboutBox ??? ??????? ????:
    m_hAccelTable = LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ACCELERATOR1));
  8. CAboutDlg ?? ??? ??? ??????? PreTranslateMessage ?? ?? ?????? ?? ??? ??? ??????? (???? ??????? ????? C++ 6.0 ??) ?? ????? ?????
  9. CAboutBox::PreTranslateMessage() ???? ??????, ??? ?? ????? ????????? ??????:
    BOOL CAboutDlg::PreTranslateMessage(MSG* pMsg) {
       if (m_hAccelTable) {
          if (::TranslateAccelerator(m_hWnd, m_hAccelTable, pMsg)) {
             return(TRUE);
          }
       }
       return CDialog::PreTranslateMessage(pMsg);
    
    }
  10. ?????? ????, ?? CTestApp ??????

????????????????? ????? F5 ?? triggers button1 ?????? ?? CAboutBox ?????? ???

??????

??????????? ????? ???? ????? ????? ??? ??????? ???? ?? ???? ??? ???????? ??????? ?? ??? ????? ?????????? ???? ?? Microsoft ???????? ??? ?????:
100770?????: ???? ????? ????? ????? ????? ?? ??? ??????????? ???????? ?? ????? ????

???

???? ID: 222829 - ????? ???????: 02 ?????? 2010 - ??????: 2.0
???? ???? ???? ??:
  • Microsoft Foundation Class Library 4.2, ?? ???? ??? ?????? ???? ???:
    • Microsoft Visual C++ 4.2 Enterprise Edition
    • Microsoft Visual C++ 5.0 Enterprise Edition
    • Microsoft Visual C++ 5.0 Professional Edition
    • Microsoft Visual C++ .NET 2002 Standard Edition
    • Microsoft Visual C++ .NET 2003 Standard Edition
??????: 
kbacceleratorkey kbhowto kbkeyaccel kbuidesign kbmt KB222829 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:222829

??????????? ???

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com