Convert OnKeyDown to WM_KEYDOWN

  • Thread starter Thread starter flaviu_
  • Start date Start date
F

flaviu_

Guest
I intend to send WM_KEYDOWN from CMyCtrl, derived from CWnd, to the parent, which is CView:

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));
}



my question is: how can I pack nChar, nRepCnt and nFlags from OnKeyDown params into WPARAM and LPARAM from WM_KEYDOWN ?

Continue reading...
 
Back
Top