????? ??????? ?????? ??????? ????? ???????? ?? ???? ?????? ?? Visual C++

?????? ????????? ?????? ?????????
???? ???????: 100770 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

??????

?????? ?????? ?? ????????? ???? ???? ????? ???? ??????? ???????. ?? ????? ????????? ???? ?????? ??? ??????? ????? ???????? ?? ???? ?????? ?????. ???? ???? ?? ???? ?? ????? ??????? ??? ???? ?? ???? ?????? ?????? ??. ???? ??? ??????? ??????? ???????? ?????? ??? ??????? ???????? ??? ???? ???? ????? ??????? MFC ?????? ??????? ????? ????????.

??????? ????

??????? ??????? ???? ??? ????? ???? ??????? Microsoft Windows ???????? Visual C++ ? "?? Microsoft Windows ????? ????? ??????" (SDK) ??????? ?????? ???? ???????? ??????? ?????? TranslateAccelerator() ?? ???? ????? ?????? ????? ??. ??? ???? ??? ??????? ???? ???? ????? ???? ??????? ??????? ?? ????? ??? ???? ????? ??????; ????? ?? ???? ?????? ??????? ?? ?????? ???? ?????? ???? ????? (??????? ?? Windows) ????? ?? ????? ???????. ??????? ???? ?? ??? ????? ??? ???? ????? ??????? ?????? ???? ?? ???????? ?????? TranslateAccelerator().

??????? ?????? ??????? ?? ???? ???? ????? ?? MFC ??? ????? ???? CWinApp::ProcessMessageFilter(). ???? ????? ????????? ProcessMessageFilter() ??? ?? ???? ??????? ?????.

?????? ??? ?? ??????? ???????? ??? ???? ???? ????? ??????? MFC ?? Visual C++ .NET ??????? ?????? ??????? ???? ???? ???? ??????? ???????:
  1. ?? Visual Studio .NET ? ????? ????? MFC ????. ?? ????? ?????? ?? "????? ??????? MFC" ? ???? ??? ??? ??????? ?? ???? ?? ????? ??? ??????? ??? ??????? ??? ???? ????.
  2. ?? ????? ??? "???????" ? ???? ????? ??????? ??? ?????? ?????? ???? ???? ?????? ??????. ???? ?????? ?????? ?????? ???? _DIALOG IDD_ MYPROJECT (??? ???? MYPROJECT ?? ????? ???? ?????? ??????? ??????? ??? ??????).
  3. ?? ???? ?????? ???????? ?? ???? ?????? ?????? ? ??? ???? ?????? "?????". ???? ?????? ????? ???? ????? ?? ??? ??? ?? ????. ??? ?????? ?????? ?? ???? ???? ???? ????? ??? ?????.
  4. ????? ???? ???? ?? ????? ????? ??? ????? ??????? ???? ???? ??? ?? ??? ??????? ???? ???? & Exit\tCTRL + E (CTRL + X ????? ????? ?? ????? ??? ??? ??????? CTRL + E ????? ?? ???).
  5. ?? ???? ??????? ???? ??? ???? ??????? "?????" ?? ?????? ??????. ?? ?????? "?????" ? ???? ?? ????? ??????? ????? ???? ??????? ????? ??? ID_FILE_EXIT.
  6. ????? ??????? ??????? ???? ?????? ?? ???? ????? ???? ??????? ?? ???? ?????? ????? ???????. ??? ???? ?????? ????? ?????? ?? ???? ?? ??????? ??????? ?? ?????? "?????". ??????? ??? ???? ?????? ???? ??????? ??????? ?? ?????? 4. ?????? ????? ???? ??? ??????? ???????? ?? ?? ????? ????? ?? ???? ??? ????? ???? ?????? ??????? ?? ???????.
  7. ?? ???? ????? ????? ??? ?????? ?????? & Exit\tCTRL + E ? ?? ???? ??? "????? ????? ???????.
  8. ?? ??????? ????? ????? ? ??? ??? ??????? COMMAND. ?? ??????? ??? ? ??? ??? ??????? CDialog ?????? ?????? ????? ??. ???? ?? ?? ??? ????? ?????? ??????? ?? ???? ??? ????? ?????? ????? ????? ????? ???? ???????.
  9. ????? ????? ?????? ?? ???? ????? ??????? ?????? ????? ????? ??????? ???? ?? ?????? ?? ?????? ??? 8:
    PostMessage(WM_COMMAND, IDOK, 0L);
    					
    ??? ???? ??? ??????? ??? ????? ??? "?????" ????? ???? ???????? ?????? ??? ????? ??? ??????? ???. ????? ??? ????? ????? ??????? ???? ??????.

  10. ????? ???? ???? ????? ?????? CTRL + E ????? ?????? ?? ID_FILE_EXIT. ??? ?????????.
  11. ????? ??? Stdafx.h ?????? ????????? ???????? ??????? ??? ?????? ????? #:
    extern HWND    ghDlg;          // Handle to main dialog box.
    extern HACCEL  ghAccelTable;   // Handle to accelerator table.
    					
  12. ?? ????? .cpp ???? ????? ??? CWinApp ????? ??? ????? (????? .cpp ????? ?? ??? ??? ??????? ??? ???????) ? ??? ??????? ?????? ??????? ????? ?????:
    HWND    ghDlg = 0;          // Handle to main dialog box.
    HACCEL  ghAccelTable = 0;   // Handle to accelerator table.
    					
  13. ?? ??????? CDialog ??? ????? (?? ?????? ????? ????? ????????? ???? ?????? ???) ? ???? ?? ????? OnInitDialog(). ??? ???????? ????? ????? ????? ??????? OnInitDialog(). ?????? ????? ???? ?????? ??? CDialog ?????? ?? ???? "??? ???" ?? ???? ??? Overrides ?? ?????? "?????". ?????? ??? ???? OnInitDialog ?? ???? ??? ?????? ??????. ??? ?? ??? ????? OnInitDialog() ???? ????? ? ???? ???? ?????? ?????? ?????.
  14. ????? ?????? ???? ??? ???????? ??????? ?????? ??? ????????? ???????? ??????:
    ghDlg = m_hWnd;
    					
  15. ?? ??? .cpp ???? ????? ??? ????? CWinApp ?????? ?????? ??? ????? ??? InitInstance(). ?? ?????? ????? ?????? ??????? ??? ??????? ????? ???????? CWinApp::InitInstance():
    ghAccelTable = LoadAccelerators(AfxGetInstanceHandle(),
    MAKEINTRESOURCE(IDR_ACCELERATOR1));
    					
    ??????: ???? ?????? ???? ??? ????????? ??? (IDR_ACCELERATOR1) ?? ????? ???? ???? ?????? ???? ??? ?????? ?? ?????? 10.

  16. ????? ????? ??? ??? ????? CWinApp ?????? ????? ProcessMessageFilter(). ?????? ????? ?? ?????? "??? ???" ??? ??? CWinApp ?????? ?? ???????. ?? ?????? "?????" ? ???? ??? Overrides. ???? ??? ?? ProcessMessageFilter ?? ?????? "?????" ?? ??? ?????? ???? ???? ????. ???? ??? ????? ??????? ?? ???? ??? ???? ????? ????? ??????? ProcessMessageFilter.
  17. ????? ????? ????? ProcessMessageFilter() ???? ????? ????? ??????:
    BOOL CMyProjectApp::ProcessMessageFilter(int code, LPMSG lpMsg)
           {
              if (code < 0)
                 CWinApp::ProcessMessageFilter(code, lpMsg);
    
              if (ghDlg && ghAccelTable)
                 {
                 if (::TranslateAccelerator(ghDlg, ghAccelTable, lpMsg))
                    return(TRUE);
                 }
    
             return CWinApp::ProcessMessageFilter(code, lpMsg);
          }
    					
  18. ????? ?? ?? ?????? ???????. ???? ???? ????? ??? ?????. ??? ????? ??? ????? ??? ??????? ??? ?? ???? ??? CTRL + E ????? ??????? ??? ?? ?????.

???????

???? ???????: 100770 - ????? ??? ??????: 30/????/1427 - ??????: 3.1
????? ???
  • Microsoft Foundation Class Library 4.2, ????? ?????? ??:
    • Microsoft Visual C++ 2.0 Professional Edition
    • Microsoft Visual C++ 2.1
    • Microsoft Visual C++ 4.0 Standard Edition
    • Microsoft Visual C++ 5.0 Standard Edition
    • Microsoft Visual C++ 6.0 Service Pack 5
    • Microsoft Visual C# .NET 2002 Standard Edition
????? ??????: 
kbmt kbacceleratorkey kbhowto kbkeyaccel kbmenu kbui KB100770 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????100770

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

 

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