Page 1 of 1

Start HIDE and Show

Posted: Thu Jan 30, 2025 11:40 am
by dilfich
Hi, how do I make this work correctly?

launching

Code: Select all

ShellExecute(Form1.Handle, '', 'cmd.exe', ' /c start SimpleOSRBrowser.exe', ExtractFilePath(paramstr(0)), SW_HIDE);
In the book, I added a timer to display the form, it doesn't work that way. :)

Code: Select all

procedure TForm1.Timer2Timer(Sender: TObject); //5s
begin
 Timer2.Enabled:= False;
  Application.ShowMainForm:= True;
  ShowWindow(Application.Handle, SW_SHOWNORMAL);
end;

Re: Start HIDE and Show

Posted: Sat Feb 01, 2025 11:12 am
by salvadordf
OSR browsers need to call TChromiumCore.WasHidden when they hide and when they are visible.

The SimpleOSRBrowser wasn't designed to be hidden initially and perhaps TChromiumCore.WasHidden is not called correctly.

Try setting the initial form coordinates to -10000, -10000 instead of hiding the form.