Help to embebed Internet Explorer into a panel

Khan Consultoria
Khan Consultoria used Ask the Experts™
on
Hello Guys,

I developed a simple project where I embebed an IE into a panel, it is ok so far.
I have two problems with my small project:

1) left and top of my IE created into a panel, I can't set it to left=0 and top = 0
2) I would like to have my IE created into my panel without any borderstyle. For this, I tried that command:
SetWindowLong(ie.Handle,GWL_STYLE,  GetWindowLong(ie.Handle,GWL_STYLE) and (not WS_CAPTION) or WS_THICKFRAME);

But I haven't had any success yet.
Web2.rar
the project has only one unit.pas and you can open it in any Delphi version. I use Delphi 2007.

After opening the project, click on the button Browse, it will create a IE into panel1, there is another button named "Mostra Pn" where a panel3 will hide or not and the IE in panel1 should resize automatically.

my code
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
  ie := CreateOleObject('InternetExplorer.Application');
  windows.setparent(ie.hwnd, panel1.handle);
  s:='http://www.microsoft.com';
  s:='https://mercado.khan.com.br/qualidade/historico.aspx';
  ie.Navigate(s);

  ie.fullscreen:=false;
  ie.MenuBar := False;
  ie.AddressBar := False;
  ie.Resizable := false;
  ie.StatusBar := True;
  ie.ToolBar := 0;

  ie.top    := 0;
  ie.left   := 0;
  ie.Width  := panel1.Width;
  ie.Height := panel1.Height+27;


  ie.visible := True;
// SetWindowLong(ie.Handle,GWL_STYLE,  GetWindowLong(ie.Handle,GWL_STYLE) and (not WS_CAPTION) or WS_THICKFRAME);  // I tried here to borderstyle=none of my IE
end;

Open in new window


I thank a lot any help
Alexandre
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Geert GOracle dba
Top Expert 2009

Commented:
you set it as not resizable ...
Software architect
Top Expert 2012
Commented:
Put it in Theater mode:
ie.TheaterMode := True;

Open in new window

This way you will get full screen explorer. Search/address bar implement by yourself.

Author

Commented:
Hello Sinisa,

You gave me a solution that solved a problem with dimension left, top, width and height, but the page was loaded with a big left margin and all the page is not fit on the browse, take a look at the picture. What do you advise me to do to solve this?

ie.png

Author

Commented:
thanks a lot for your help

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial