Click to See Complete Forum and Search --> : How can I get when the user press Enter Key in PreTranslateMessage ?


Braulio
May 5th, 1999, 03:35 AM
Hi,

I have a property sheet, and I want that when the user press enters it don't close, I have thought in get when the user press the enter key in the pretranslate message of the sheet and throw it away, but I do't know how to trap the enter key...

Anybody can help me ? Thanks, Bye !
Braulio

shridhar rao
May 5th, 1999, 06:46 AM
You are right about overriding the PreTranslateMessage. What you have to do here is this. One of the parameters is the MSG structure. In the overridden function put a condition like this
if(pMsg->wParam == 13)
{
//do something here
return 1;
}
else
//return the default
I hope this solves ur problem

Braulio
May 5th, 1999, 07:10 AM
Thanks !

What I do know is check if it's WM_CHAR and wParam==13 ( Intro), and works good, Thanks:
Braulio

P.S.: What it's the difference between return 1 or 0 ?.