Jump to content
alogrep

THintWindow; exposing the WMLButtonDown event

Recommended Posts

Hi

I got this neat piece of code froma OpenAI GPT searc


 
type
  TMyHintWindow = class(THintWindow)
  protected
    procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN;
  end;

procedure TMyHintWindow.WMLButtonDown(var Message: TWMLButtonDown);
begin
  // Close the hint window when clicked
  ReleaseHandle;
end;

I put the first part in the interface section, the second in the implementation.

But the the WMLButtonDown   (clic left button, right?) never gets triggered.

What is missing to make it work?

Also, in case I make it work, I lso have set the timerr to hide it after 2 seconds. In the timere I use wh (The TMyHintWindow control)

if wh <> Nil then begin   

  wh.releasehandle.

  wh.free;

  wh:=Nil;

end.

How can I make the same inside  the WMLButtonDown event?

Thanks very much.

 

  wh

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×