Help to embebed Internet Explorer into a panel

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
Khan ConsultoriaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Geert GOracle dbaCommented:
you set it as not resizable ...
Sinisa VukSoftware architectCommented:
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Khan ConsultoriaAuthor 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
Khan ConsultoriaAuthor Commented:
thanks a lot for your help
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.