• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

Open at new window

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

Thanx for help...
0
mece
Asked:
mece
  • 4
  • 4
1 Solution
 
geobulCommented:
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
0
 
BedouinDNCommented:
You can try using CreateOLEObject (This will open in new window, but will only work for Internet Explorer).. I.E

uses
ComObj;

TForm1.Button1Click(Sender: TObject);
var
IE: Variant;
begin
IE := CreateOLEObject('InternetExplorer.Application);
IE.Navigate('http://www.url.com');
end;

This also gives you access to quite a lot within the new browser window.

More details on the InternetExplorer Object and its members etc is available at:
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/reference/objects/internetexplorer.asp

Cheers.
Bed..
0
 
meceAuthor Commented:
sorry but it is not working.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Thanx for help...
0
 
geobulCommented:
Have you tried my solution? Why something to be simple when it could be complex, right?
0
 
meceAuthor Commented:
i wrote it early but i woulnt work on all systems. It crashed once geobul.
But thanx for relpying...
0
 
geobulCommented:
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.
0
 
meceAuthor Commented:
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.
0
 
geobulCommented:
Every time I press the button I get a new IE window opened. But that's enough - you got your answer.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now