comp.lang.ada
 help / color / mirror / Atom feed
* Win32ADA Edit Control Notification
@ 1999-04-28  0:00 Shawn Barber
  1999-05-06  0:00 ` guru_upya
  0 siblings, 1 reply; 3+ messages in thread
From: Shawn Barber @ 1999-04-28  0:00 UTC (permalink / raw)


I tried to use an edit control for the first time in a piece of software I
am developing. I can't seem to
trap the EN_CHANGE and the EN_UPDATE messages. I have been able to trap the
EN_SETFOCUS
and EN_KILLFOCUS messages. I need some new things to try. I've tried
checking the high word of
the wParam of a WM_SYSCOMMAND with no luck.

Shawn Barber
SBarber@Sikorsky.com



**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Win32ADA Edit Control Notification
  1999-04-28  0:00 Win32ADA Edit Control Notification Shawn Barber
@ 1999-05-06  0:00 ` guru_upya
  1999-05-06  0:00   ` David Botton
  0 siblings, 1 reply; 3+ messages in thread
From: guru_upya @ 1999-05-06  0:00 UTC (permalink / raw)


In previous versions of Windows, the notification code was in HIWORD(lParam)
for EN_KILLFOCUS. For the EN_CHANGE and ... UPDATE it is as follows in MFC
EN_CHANGE idEditCtrl = (int) LOWORD(wParam); // identifier of edit control
hwndEditCtrl = (HWND) lParam;  // handle of edit control

Hope this helps,

In article <%fGV2.672$4S.363025@WReNphoon3>,
  sbarber@snet.net (Shawn Barber) wrote:
> I tried to use an edit control for the first time in a piece of software I
> am developing. I can't seem to
> trap the EN_CHANGE and the EN_UPDATE messages. I have been able to trap the
> EN_SETFOCUS
> and EN_KILLFOCUS messages. I need some new things to try. I've tried
> checking the high word of
> the wParam of a WM_SYSCOMMAND with no luck.
>
> Shawn Barber
> SBarber@Sikorsky.com
>
> **** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm)
****
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Win32ADA Edit Control Notification
  1999-05-06  0:00 ` guru_upya
@ 1999-05-06  0:00   ` David Botton
  0 siblings, 0 replies; 3+ messages in thread
From: David Botton @ 1999-05-06  0:00 UTC (permalink / raw)


It still is, but it should come in as a WM_COMMAND, not WM_SYSCOMMAND.

Try something like this:

      case message is
         when WM_COMMAND =>
            declare
               wmID              : Win32.WORD :=
                 Win32.WinDef.LOWORD(Win32.DWORD(WPARAM));
               Notification_Code : Win32.WORD :=
Win32.WinDef.HIWORD(Win32.DWORD(WPARAM));
           begin

                case Notification_Code is
                    when EN_KILLFOCUS =>
                    if wmID = MY_EDIT_CONTROL_ID then
                    .
                    .
                    .
                    when EN_UPDATE =>

           end;
        .
        .
        .

I use a system where I use the extra bits in a Windows window to store a pointer to
an Ada object and since the HWND is passed in the lParam:

               Control_Window : Pointer := To_GWindow(

Win32.WinUser.GetWindowLong(To_HWND(lParam),Win32.WinUser.GWL_UserData) );


Then I can dispatch the Notification_Code directly to the Ada object that handles
the control with:

return On_Message(Control_Window, Message, wParam, lParam);

Be well,
David Botton


guru_upya@yahoo.com wrote:

> In previous versions of Windows, the notification code was in HIWORD(lParam)
> for EN_KILLFOCUS. For the EN_CHANGE and ... UPDATE it is as follows in MFC
> EN_CHANGE idEditCtrl = (int) LOWORD(wParam); // identifier of edit control
> hwndEditCtrl = (HWND) lParam;  // handle of edit control
>
> Hope this helps,
>
> In article <%fGV2.672$4S.363025@WReNphoon3>,
>   sbarber@snet.net (Shawn Barber) wrote:
> > I tried to use an edit control for the first time in a piece of software I
> > am developing. I can't seem to
> > trap the EN_CHANGE and the EN_UPDATE messages. I have been able to trap the
> > EN_SETFOCUS
> > and EN_KILLFOCUS messages. I need some new things to try. I've tried
> > checking the high word of
> > the wParam of a WM_SYSCOMMAND with no luck.
> >
> > Shawn Barber
> > SBarber@Sikorsky.com
> >
> > **** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm)
> ****
> >
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-05-06  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-28  0:00 Win32ADA Edit Control Notification Shawn Barber
1999-05-06  0:00 ` guru_upya
1999-05-06  0:00   ` David Botton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox