CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2002
    Posts
    214

    where did F10 go?

    hi, gurus,

    i have a question about the keydown message. i have a single document application based on MFC, using VC7.1. But it seems that app cannot get the keydown message of F10. Even if i set break point at CxxxApp::PretranslateMessage().

    Does anyone know what is the problem?

    need i to set a keyhook to solve this problem?

    thanks.

  2. #2
    Join Date
    Feb 2002
    Posts
    5,757
    Post the code that checks for the F10 key code.

    Kuphryn

  3. #3
    Join Date
    Dec 2002
    Posts
    214
    Code:
    BOOL CXXXXXXApp::PreTranslateMessage(MSG* pMsg)
    {
    
    if(WM_KEYDOWN == pMsg->message && VK_F2<=pMsg->wParam && VK_F10>=pMsg->wParam)
    	{
    		TRACE("translating F%d\n",pMsg->wParam-VK_F1+1);
    	}
    	return CWinApp::PreTranslateMessage(pMsg);
    }

  4. #4
    Join Date
    Feb 2002
    Posts
    5,757
    Interesting. Consider this solution.

    if (WM_KEYFIRST <= pMsg->message &&
    pMsg->message <= WM_KEYLAST &&
    pMsg->wParam >= VK_FX &&
    pMsg->wParam <= VK_FY)
    {}

    Kuphryn

  5. #5
    Join Date
    Dec 2002
    Posts
    214
    , thanks,
    i found that F10 is a syskey which activate the menu..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured