Link to home
Start Free TrialLog in
Avatar of mece
mece

asked on

Open at new window

how to open a web page at new internet explorer window always??
must work for all windows...

Thanx for help...
Avatar of geobul
geobul

Hi,

Place an edit box and a button on a form and try this:

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShellExecute(0, 'open', 'iexplore.exe', PChar(Edit1.Text), nil, SW_SHOWNORMAL);
end;

where the link is entered in Edit1.

Regards, Geo
ASKER CERTIFIED SOLUTION
Avatar of BedouinDN
BedouinDN

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mece

ASKER

sorry but it is not working.
Avatar of mece

ASKER

IE := CreateOLEObject('InternetExplorer.Application');
IE.Visible := true;
IE.Navigate('http://www.url.com');

Thanx for help...
Have you tried my solution? Why something to be simple when it could be complex, right?
Avatar of mece

ASKER

i wrote it early but i woulnt work on all systems. It crashed once geobul.
But thanx for relpying...
I really doubt that. ShellExecute works on all Windows versions. IExplore.exe is the name of the program to execute and it is always in the search path. If this crashes then the other one will crash too. That means something important in the OS is missing.
Avatar of mece

ASKER

no i mean with crashes, when you execute that code, that page can be opened on any IE window that is opened, not in a new window.
Every time I press the button I get a new IE window opened. But that's enough - you got your answer.