Click to See Complete Forum and Search --> : Enter-button override


Morftje
July 2nd, 1999, 03:14 AM
I overrided my SDI-FormView-View with PreTransLateMessage(MSG* pMsg), so I was able to override my left and right arrows. Now I want to override my Return&Enter buttons, but I do not know the Virtual Key Code. Can U help me out?

Student Flanders Language Valley
Programmer

Sasa
July 2nd, 1999, 03:19 AM
The code for enter is VK_ENTER.
Sasa

Morftje
July 2nd, 1999, 04:10 AM
Sasa, It's not working! The following function gives an error on VK_ENTER(undeclared identifier):

BOOL CMenuutjeView::PreTranslateMessage(MSG* pMsg)
{
CMenuutjeDoc* pDoc=GetDocument();
// TODO: Add your specialized code here and/or call the base class
if(pMsg->message == WM_KEYDOWN)
{
bool bProcessed = false;
if (pMsg->wParam == VK_LEFT)
{
bProcessed = true;
pDoc->Verschuif(false);
Invalidate();
}
if (pMsg->wParam == VK_RIGHT)
{
bProcessed = true;
pDoc->Verschuif(true);
Invalidate();
}
if (pMsg->wParam == VK_ENTER)
{
bProcessed = true;
MessageBox("ENTER");
OnEnter();
}
if (bProcessed)
return true;
}
return CFormView::PreTranslateMessage(pMsg);
}



What could possibly be the problem?

Student Flanders Language Valley
Programmer

Franky Braem
July 2nd, 1999, 04:18 AM
Use VK_RETURN.

Sasa
July 2nd, 1999, 04:33 AM
I just suggested to use VK_ENTER, but I didn't said how to do it.
Greetings, Sasa

Sasa
July 2nd, 1999, 04:35 AM
Virtual key VK_RETURN does not exist.
Sasa

Franky Braem
July 2nd, 1999, 04:37 AM
I use VK_RETURN in my PreTranslateMessage. So it does exist !

Morftje
July 2nd, 1999, 04:46 AM
Thanx, Franky, VK_RETURN works just fine!
Thanx to you too, Sasa!

Student Flanders Language Valley
Programmer

Sasa
July 2nd, 1999, 05:14 AM
Sorry, i've searched for it MSDN Library and VK_RETURN isn't there.
Sasa