How to make a simple Link ? lazarus / 9-Editor ---------------------------------------------------------------------- Nisbo · 2005-03-08 15:15 first, sorry for my bad english, but i am from germany How to make a simple Link ? this is my questing, i searched in google and I found for delphi: ShellExecute(handle,nil,'http://www.google.de',nil,SW_SHOW) shellexecute(0, 'open', 'http://www.google.de', nil, nil, sw_show); but it doesnt work in lazarus maybe there is an other funktion to make a simple html-link like a link to a supportpage ---------------------------------------------------------------------- Nisbo · 2005-03-10 09:54 OK no answer is also an answer  :roll: the solution is insert inso uses: ShellAPI and you can use procedure TForm1.MenuItem3Click(Sender: TObject); var sw_show: longint; begin      Shellexecute(handle,'open',PChar('http://www.google.de'),'','',sw _show); end; ---------------------------------------------------------------------- Nisbo · 2005-03-10 14:03 OK next question I try to open notepad (W2K) Shellexecute(Application.Handle,'open',PChar('C:\WINNT\NOTEPAD.EXE'),n il,nil,sw_show); but it doesnt work, whats wrong ? ---------------------------------------------------------------------- Anonymous · 2005-03-10 17:18 Use ExecuteProcess instead Try like this: ExecuteProcess('C:\WINNT\NOTEPAD.EXE',''); second arguments are arguments passed to Notepad ---------------------------------------------------------------------- Nisbo · 2005-03-10 17:28 ok my mistake was that i forgot to insert Windows in units now it works procedure TForm1.MenuItem5Click(Sender: TObject); begin      Shellexecute(handle,'open',PChar('http://www.google.de'),'','',sw _show); end; ---------------------------------------------------------------------- Lightning · 2005-03-15 07:30 Also don't use Application.Handle, that handle is invalid, bug ... ---------------------------------------------------------------------- Hansaplast · 2007-06-17 00:17 Is there a universal way on to how to make a click able link suitable for all platforms? Using Windows specific units comes with complications for Linux etc?? (or not?) ---------------------------------------------------------------------- antonio · 2007-06-17 02:18 Quote from: "Hansaplast"Using Windows specific units comes with complications for Linux Not necessarily. Anyway, you can put IFDEF directive in your code. Code: [Select] {$IFDEF WINDOWS} // Windows specific part {$ENDIF} ---------------------------------------------------------------------- Hansaplast · 2007-06-17 02:21 IFDEF is a good approach,... if I would know; a) which platform identifications I'd use in the IFDEF (win32, linux,... but not sure about Mac OSX and such?) b) what to call for on the other platforms (which I do not - yet) ---------------------------------------------------------------------- antonio · 2007-06-17 02:23 I edited my post after you posted yours. See it again. For a complete example, see eg. SynEdit source. ---------------------------------------------------------------------- Hansaplast · 2007-06-17 03:07 Thanks ---------------------------------------------------------------------- dje · 2022-06-30 05:30 Quote from: Hansaplast on June 17, 2007, 02:17:55 amIs there a universal way on to how to make a click able link suitable for all platforms? Using Windows specific units comes with complications for Linux etc?? (or not?) I use OpenURL and OpenDocument from the unit LCLIntf. The only problem I found on the Raspberry Pi, is when xdg-open is not setup with a valid default browser. The following will show your current default browser Code: [Select]xdg-settings get default-web-browser I believe I had to use something like this to make it work with firefox. (I guess it depends on the linux distro) Code: [Select]xdg-settings set default-web-browser firefox-esr.desktop ---------------------------------------------------------------------- MarkMLl · 2022-06-30 07:17 You're commenting to a thread that's 15 years old, and most if not all of the participants have moved on. Quote from: derek.john.evans on June 30, 2022, 07:30:18 amI use OpenURL and OpenDocument from the unit LCLIntf. The only problem I found on the Raspberry Pi, is when xdg-open is not setup with a valid default browser. That is of course an interesting point, and you deserve a point for investigating xdg-open. However you've got a definite distro bug there, and you need to make sure it's reported as a bug to the RPi maintainers. MarkMLl