Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SendMessage(EN_CHANGE) doesn't work.

572 views
Skip to first unread message

hassan

unread,
Feb 11, 1999, 3:00:00 AM2/11/99
to
Hi all,

In a vesrion of my app., i have a dialog box that has an edit control, a
combobox control and a disabled OK button.
the dialog class has a function func1, mapped to EN_CHANGE message,
which enables the button when text is entred in the edit control.

in the second version, i have hidden the edit control and made a second
function, func2, mapped to ON_CBN_EDITCHANGE, which enables or disables
the button following whether or not there is text in the combo control.

in the third version, i want to remove the code that enables and
disables the boutton from func2, and make func1 be called instead.

to do this, i used two ways but no one of them worked. The button is not
enabled.

methode 1:
i used the following code in func2:
pEdit->SendMessage(EN_CHANGE); // pEdit is a pointer on the hidden edit
control.

methode2:
i copied the text in the combo to the hidden edit control using
pEdit->SetWindowText.

how can i make both methods work ? where have i gone wrong ?

Thank you in advance.


Ajay Kalra

unread,
Feb 11, 1999, 3:00:00 AM2/11/99
to
I did not really understand your motivation but EN_CHANGE is a notification
from a CEdit. This is not a message to CEdit(EM_????). You will have to
change the control thru some other means(SetWindowText() etc) which would
cause this notification to be sent from the control.

Ajay

hassan wrote in message <36C32C91...@mail.com>...

Richard

unread,
Feb 15, 1999, 3:00:00 AM2/15/99
to

hassan wrote in message <36C32C91...@mail.com>...
>
>
>methode 1:
>i used the following code in func2:
>pEdit->SendMessage(EN_CHANGE); // pEdit is a pointer on the hidden edit
>control.


Try:

pEdit->SendMessage(WM_COMMAND, MAKEWPARAM(pEdit->GetDlgCtrlID(),
EN_CHANGE) );

0 new messages