mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-26 19:12:18 -05:00
843c57a8d8
git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@465 3f818213-9676-44b0-a9b4-5e4c4e03d09d
43 lines
826 B
ObjectPascal
43 lines
826 B
ObjectPascal
unit web;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes, SysUtils,LazHelpHTML,UTF8Process;
|
|
|
|
procedure OpenWebPage(URL: string);
|
|
|
|
implementation
|
|
|
|
|
|
procedure OpenWebPage(URL: string);
|
|
var
|
|
v: THTMLBrowserHelpViewer;
|
|
BrowserPath, BrowserParams: string;
|
|
p: LongInt;
|
|
BrowserProcess: TProcessUTF8;
|
|
begin
|
|
v:=THTMLBrowserHelpViewer.Create(nil);
|
|
try
|
|
v.FindDefaultBrowser(BrowserPath,BrowserParams);
|
|
p:=System.Pos('%s', BrowserParams);
|
|
System.Delete(BrowserParams,p,2);
|
|
System.Insert(URL,BrowserParams,p);
|
|
|
|
// start browser
|
|
BrowserProcess:=TProcessUTF8.Create(nil);
|
|
try
|
|
BrowserProcess.CommandLine:=BrowserPath+' '+BrowserParams;
|
|
BrowserProcess.Execute;
|
|
finally
|
|
BrowserProcess.Free;
|
|
end;
|
|
finally
|
|
v.Free;
|
|
end;
|
|
end;
|
|
end.
|
|
|