Jeremy

I haven't been following this thread intensly but would the following help?


In the form's PRIVATE section enter:

   Procedure CMDialogKey(Var Msg:TWMKey); message CM_DIALOGKEY;

In the form's IMPLEMENTATION section enter:

   Procedure TForm1.CMDialogKey(Var Msg: TWMKey);
   Begin
      If NOT (ActiveControl Is TButton) Then
         If Msg.Charcode = 13 Then
            Msg.Charcode := 9;
      inherited;
   End;


It gives you the active control

HTH
Neven


----- Original Message -----
From: Jeremy Coulter <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Tuesday, 17 October 2000 12:05
Subject: [DUG]: Keypress


> Hi all.
>
> using windows keyboard hooks, is it posible to get the handle of the
> window/control that the key is being pressed in/on ??
>
> Cheers, Jeremy Coulter
>
>
****************************************************************************
****
> This email or attachment(s) may contain confidential or legally privileged
> information intended for the sole use of the addressee(s). Any use,
redistribution,
> disclosure, or reproduction of this message, except as intended, is
prohibited.
> If you received this email in error, please notify the sender and erase
all
> copies of the message, including any attachments.
>
> Any views or opinions expressed in this email (unless otherwise stated)
may not
> represent those of Pegasus Health Ltd.
>
>
****************************************************************************
****
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to