Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

demo "EditorBrowser" active cursor to write at startup

Post Reply
ericktux
Posts: 18
Joined: Thu Oct 29, 2020 10:11 am

demo "EditorBrowser" active cursor to write at startup

Post by ericktux »

good morning, a question, in the demo "EditorBrowser" how can I start the application with the active cursor to be able to write quickly?

I am using lazarus on windows 10
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: demo "EditorBrowser" active cursor to write at startup

Post by salvadordf »

Hi,

Add a TTimer called "Timer2", set the Timer2.Interval property to 1000 ms and Timer2.Enabled to FALSE.

Add this code in TForm1.BrowserCreatedMsg :

Code: Select all

procedure TForm1.BrowserCreatedMsg(var aMessage : TMessage);
begin
  Caption := 'Editor Browser';
  Timer2.Enabled := True;
end;  
Then add this code in the Timer2.OnTimer event :

Code: Select all

procedure TForm1.Timer2Timer(Sender: TObject);
begin
  Timer2.Enabled := False;
  PostMessage(Chromium1.RenderHandle, WM_LBUTTONDOWN, 0, 0);
  PostMessage(Chromium1.RenderHandle, WM_LBUTTONUP, 0, 0);
end;   
Post Reply