Don't we have a OpenURL() function just for for that (in LCLIntf unit)? Bart
On 10/12/11, Mattias Gaertner <[email protected]> wrote: > On Wed, 12 Oct 2011 13:55:08 +0200 > Reinier Olislagers <[email protected]> wrote: > >> Hi list, >> >> I'm trying to open an URL in the user's browser. I've edited the example >> from the wiki >> http://wiki.lazarus.freepascal.org/Executing_External_Programs#Open_web_page_in_default_web_browser >> until it compiles but I suspect I'm sending the wrong Params. >> >> A quick look through the LCLIntf code wasn't enlightening either. >> >> How should I write this procedure? >> >> Thanks >> Reinier >> > uses Process, LCLIntf > ... > procedure OpenWebPage(URL: string); > var > Browser, Params: string; > begin > FindDefaultBrowser(Browser, Params); > > The params are currently done for the old version of TProcess. The URL > is quoted. > > with TProcess.Create(nil) do > try > Executable := Browser; > Params:=Format(Params, [URL]); > Params:=copy(Params,2,length(Params)-2); > Parameters.Add(Params); > Options := [poNoConsole]; > Execute; > finally > Free; > end; > end; > > > Mattias > > -- > _______________________________________________ > Lazarus mailing list > [email protected] > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
