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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Start HIDE and Show

Post Reply
dilfich
Posts: 368
Joined: Thu Nov 30, 2017 1:17 am

Start HIDE and Show

Post 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;
User avatar
salvadordf
Posts: 4563
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Start HIDE and Show

Post 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.
Post Reply