Board index » delphi » wewriting OnMessage handler

wewriting OnMessage handler

I've modified my own OnMessage handler so I can capture a tab key.  The
hWnd parameter of a
TMessageEvent gives the handle of the window to which the message is
going.  this works fine to
capture a tab key that was 'destined' for a Tedit box (it matches the
Tedit box's handle), but i'm guessing, since the ComboBox is like a list
box and and edit box put together there are separate handles or
somethting... anyway, the handle of a specific combo box is not the
value of hWnd when i type the TAB key inside the combo box.  I was
looking at the procedure, 'ComboWndProc' for clues, but i dont' know how
this procedure is used.  help and the vcl manual aren't too helpful on
this. Anyone have a clue how i can capture a tab key from a ComboBox.

Thanks,

Matt Phillips
matthew.phill...@frequentis.sk

 

Re:wewriting OnMessage handler


Matthew Phillips schrieb in Nachricht <377B74F5.B3B99...@frequentis.sk>...

Quote
>I've modified my own OnMessage handler so I can capture a tab key.  The
>hWnd parameter of a
>TMessageEvent gives the handle of the window to which the message is
>going.  this works fine to
>capture a tab key that was 'destined' for a Tedit box (it matches the
>Tedit box's handle), but i'm guessing, since the ComboBox is like a list
>box and and edit box put together there are separate handles or
>somethting... anyway, the handle of a specific combo box is not the
>value of hWnd when i type the TAB key inside the combo box.  I was
>looking at the procedure, 'ComboWndProc' for clues, but i dont' know how
>this procedure is used.  help and the vcl manual aren't too helpful on
>this. Anyone have a clue how i can capture a tab key from a ComboBox.

>Thanks,

>Matt Phillips
>matthew.phill...@frequentis.sk

There exist a protected property named EditHandle in TComboBox, which offers
the handle of the editor inside the ComboBox. You can access this protected
property by defining a new component in your module:

type
  TDummyComboBox = class(TComboBox)
  end;

Then you can access then Handle by following code:

EditHandle:= TDummyComboBox(AComboBox).EditHandle;

Other Threads