Lazarus: Open Website independent from Platform
Question by Guest | Last update on 2024-01-23 | Created on 2013-03-22
Currently, I am writing an application using Lazarus that should run on Windows, Mac and Linux. Now, I would like to set a link to my website within the program. Of course, this link should also be platform independent and should work on all of these operating systems.
As a former Delphi user, I have done this using ShellExecute and the Open command. Unfortunately, of course, this is a Windows specific function that cannot be used on a Mac or on Linux. Does anyone know a way how to set up and open a link with Lazarus?
Related Topics
Lazarus: Open File or Document platform-independent
Tip | 0 Comments
Delphi/Lazarus: How to set up a Link to a Website in an Application
Tutorial | 0 Comments
Delphi/Lazarus: Command Line Parameter Tutorial Part 1: Sending
Tutorial | 0 Comments
Definition: What are High Heels?
Info | 1 Comment
Delphi: Multiline Caption for TLabel (at Run Time and Design Time)
Tutorial | 1 Comment
Lazarus: Rename or Move File
Tip | 0 Comments
Is it easier to walk on platform pumps compared to normal high heels?
Question | 3 Answers
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
Compared to Delphi, with Lazarus it is much easier to set a retrievable link to a website.
Simply use the function OpenUrl, for which you only have to include the unit LCLIntf:
OpenUrl finds the default browser on each system and opens the specified URL with that browser. Important: Don't forget the "http" or "https" at the beginning of the URL.
You can also use OpenURL to open files, for example: OpenUrl('file://C:\file.txt'). But in that case, you can also just use OpenDocument() and pass a path to a file.
Last update on 2024-01-23 | Created on 2013-03-24