Re: Open Internet Explorer (6.0) at a specified url

Posted by webmaster Guido on August 27, 2002

In Reply to: Open Internet Explorer (6.0) at a specified url posted by Met@ on August 26, 2002

: I want to open Internet Explorer (6.0) with an EXE program. I want to make that program with Delphi. Internet Explorer has to be opened at a url that is specified in the script. Is this possible? If it is: how can I do this?

For opening a registered file under control of your Delphi program, you can use the Windows API-function ShellExecute. You have to specify the path of that file as one of the parameters of the function. Now here's the trick: if instead you pass a URL, your default web-browser is opened with that URL. Example:

ShellExecute(Handle, 'open', PChar(''), nil, nil, SW_SHOW); 

By the way, that same function can also be used for running an external application, opening a folder, printing a file, and so on.

In DelphiLand's section "Code snips", there is an article about this under the heading "Running an external application". There's also a downloadable example project.

Related Articles and Replies:

Find related articles

Search for:  shellexecute

Delphi Forum :: Tutorials :: Source code :: Tips