alogrep 0 Posted 7 hours ago 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
Lars Fosdal 1861 Posted 1 hour ago Did you override the HintWindowClass before Application.Run is executed? https://docwiki.embarcadero.com/Libraries/Athens/en/Vcl.Controls.THintWindowClass Share this post Link to post