OpenURL

This is an old revision of OpenURL, edited by Bart at . The current revision is 86069.

/* Description */

Template:Translate

Definition

Unit: Lazarus lclintf

function OpenURL(AURL: String): Boolean;

Official documentation: http://lazarus-ccr.sourceforge.net/docs/lcl/lclintf/openurl.html

Description

openurl opens an URL with the default/registered web browser as specified by the operating system.

Apparently spaces need to be encoded (as %20); see http://www.ietf.org/rfc/rfc1738.txt

On Windows, opening an URL using the file:// URI scheme (to open a local file) may fail if there are spaces in the filename (you should not escape spaces with %20 in this case).
This is unfortunately system and browser dependant. On "modern" Windows (XP and later) it may help to enclose the entire string in double quotes: "file://some file.htm", whereas this will fail on Win9x systems (See bug 21659 in the bugtracker)

Example

uses 
...
lclintf
...
OpenURL('http://wiki.lazarus.freepascal.org/');