CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 14 of 14

Thread: Sending WM_KEYDOWN from OnKeyDown

Threaded View

  1. #1
    Join Date
    Jan 2009

    Convert OnKeyDown to WM_KEYDOWN

    How can I translate OnKeyDown to WM_KEYDOWN ? I mean, where can I put nRepCount inside lParam ?
    void CMyCtrl::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
    	// TODO: Add your message handler code here and/or call default
    	CWnd::OnKeyDown(nChar, nRepCnt, nFlags);
    	::SendMessage(GetParent()->GetSafeHwnd(), WM_KEYDOWN, (WPARAM)nChar, LPARAM(nFlags));
    is correct like this ?
    ::SendMessage(GetParent()->GetSafeHwnd(), WM_KEYDOWN, (WPARAM)nChar, MAKELPARAM(nRepCnt, nFlags));
    I guess not …
    Last edited by mesajflaviu; April 19th, 2019 at 01:29 AM.

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)