Topic: Web browser on MVD form?

Is it possible to run default web browser on a MVD form?


Not looking for embedding a web browser; just want to run already installed web browser such as firefox, google chrome, opera etc., on MVD form.

Adam
God... please help me become the person my dog thinks I am.

Re: Web browser on MVD form?

procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
    OpenFile('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe');
end;

Domebil

Re: Web browser on MVD form?

You can open any url to run default web browser

OpenURL('http://google.com');
Dmitry.

4 (edited by k245 2019-09-24 15:52:41)

Re: Web browser on MVD form?

You can pin the window of any application inside the MVD application. See an example for a calculator. It can also be used for the browser.

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
var
    h: integer;
    Max: integer;
begin
      // run calculator
      OpenFile('calc.exe');

      // finding window's calculator
      h := 0;
      Max := 20;
      while (h = 0) and (Max > 0) do
      begin
          h := FindWindow('', 'Calculator'); // find window using caption
          Dec(Max);
          Sleep(50);
      end;

      // move the calculator to the Form1
      if h <> 0 then
      begin
          SetWindowPos( h, 0, 10, 10, 0, 0, SWP_NOSIZE); // set position x=10, y=10
          SetParent( FindWindow('', 'Calculator'), Form1.Handle);
      end;
end;

P.S. It's not work on Win10


http://myvisualdatabase.com/forum/viewtopic.php?id=2957

Визуальное программирование: блог и телеграм-канал.

Re: Web browser on MVD form?

C:\Windows\System32\calc.exe

Domebil

Re: Web browser on MVD form?

domebil wrote:

C:\Windows\System32\calc.exe

You want to say that in MVD  can only glue 32-bit applications?

Визуальное программирование: блог и телеграм-канал.

7 (edited by domebil 2019-09-25 06:08:04)

Re: Web browser on MVD form?

Even if it is 64-bit the launcher is always in the System32 folder.
You can create windows commands by creating a bat file.

Domebil

Re: Web browser on MVD form?

k245 wrote:

You can pin the window of any application inside the MVD application. See an example for a calculator. It can also be used for the browser.

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
var
    h: integer;
    Max: integer;
begin
      // run calculator
      OpenFile('calc.exe');

      // finding window's calculator
      h := 0;
      Max := 20;
      while (h = 0) and (Max > 0) do
      begin
          h := FindWindow('', 'Calculator'); // find window using caption
          Dec(Max);
          Sleep(50);
      end;

      // move the calculator to the Form1
      if h <> 0 then
      begin
          SetWindowPos( h, 0, 10, 10, 0, 0, SWP_NOSIZE); // set position x=10, y=10
          SetParent( FindWindow('', 'Calculator'), Form1.Handle);
      end;
end;

P.S. It's not work on Win10


http://myvisualdatabase.com/forum/viewtopic.php?id=2957



Thanks a lot guys...
I couldn't use the above script to pin a browser on to a form1 or panel1
I'd prefer pin to panel


Here is a sample project for a kind soul to make it work

Post's attachments

Attachment icon WebBrowserPin.zip 6.15 kb, 444 downloads since 2019-09-26 

Adam
God... please help me become the person my dog thinks I am.

Re: Web browser on MVD form?

Does anyone have anything new on this.
Under windows 10 it does not work.
The browser window is not trasfered to Form1.

Thank you