Braulio
April 29th, 1999, 04:47 AM
Hi !,
When someone types one character on an edit control, how can I know wich character has been written ?
Thanks, Bye !
Braulio
Lothar Haensler
April 29th, 1999, 05:52 AM
by subclassing the edit control and trapping the WM_CHAR message...
tchung
April 29th, 1999, 07:29 AM
Use PreTranslateMessage() !
Override PreTranslateMessage() in that class using classwizard and type code like this
......::PreTranslateMessage(MSG* pMsg)
{
CEdit *pEdit = (CEdit *)GetDlgItem(IDC_EDIT1);
if(pMsg->message == WM_CHAR)
{
if(GetFocus()==pEdit) {
// here code to find character
}
}
}
by nfuox
Braulio
April 29th, 1999, 08:05 AM
SUPER !! WORKS QUITE GOOD !
Hi,
Thanks for your help, it works good !!
One question more about this "PreTranslateMessage", is possible too, to put out message that I don't want ?, for example I have a problem with DropDown and SetSelEndOk, of the combo boxes, every time DorpDown is called, SetSelEndOk is called after, is possible to take the message that recieves SetSelEndOk, and put it out ? What Happens with the function that has sended the "SendMessage" keeps waiting always or not ?...
Another question ( a little bit more silly ;-) ), is there something like a "PosTranslateMessage" ( when the message has been received and proccessed capture it and set somethings...).
Thanks very much for your help Bye !
Braulio