hi, i'm writing a dialog based app. i use some keyboard shortcuts with PreTranslateMessage, this all works with (euh) "keys that start with VK_" like the function keys, escape, delete, ... but not with normal letters. I'd like to redirect to a function when the dollar key is pressed down! here is the function code i use now:
BOOL CKassaDlg:reTranslateMessage(MSG* pMsg)
{
switch(pMsg->message)
{ case WM_KEYDOWN: switch(pMsg->wParam)
{ case VK_ESCAPE: OnButtonsluiten();
return TRUE;
case VK_F4: ArtikelGeefAantal();
return TRUE;
case VK_F5: OnButtonTotaal();
return TRUE;
case VK_F6: OnButtonnieuwart();
return TRUE;
case VK_F7: OnButtoneditart();
return TRUE;
case VK_F8: OnButtonleveringen();
return TRUE;
case VK_DOLLAR: OnButtonleveringen();
return TRUE;
case VK_DELETE: ArtikelDelete();
return TRUE;
case VK_ADD: ArtikelPlus();
return TRUE;
case VK_RIGHT: ArtikelPlus();
return TRUE;
case VK_SUBTRACT: ArtikelMin();
return TRUE;
case VK_LEFT: ArtikelMin();
return TRUE;
}
}
return CDialog:reTranslateMessage(pMsg);
}
Thanx! Josphin.
BOOL CKassaDlg:reTranslateMessage(MSG* pMsg)
{
switch(pMsg->message)
{ case WM_KEYDOWN: switch(pMsg->wParam)
{ case VK_ESCAPE: OnButtonsluiten();
return TRUE;
case VK_F4: ArtikelGeefAantal();
return TRUE;
case VK_F5: OnButtonTotaal();
return TRUE;
case VK_F6: OnButtonnieuwart();
return TRUE;
case VK_F7: OnButtoneditart();
return TRUE;
case VK_F8: OnButtonleveringen();
return TRUE;
case VK_DOLLAR: OnButtonleveringen();
return TRUE;
case VK_DELETE: ArtikelDelete();
return TRUE;
case VK_ADD: ArtikelPlus();
return TRUE;
case VK_RIGHT: ArtikelPlus();
return TRUE;
case VK_SUBTRACT: ArtikelMin();
return TRUE;
case VK_LEFT: ArtikelMin();
return TRUE;
}
}
return CDialog:reTranslateMessage(pMsg);
}
Thanx! Josphin.