Recent

Author Topic: Portable opening (default) applications  (Read 569 times)

Borneq

  • Full Member
  • ***
  • Posts: 248
Portable opening (default) applications
« on: January 28, 2020, 12:03:38 pm »
In windows I have
Code: Pascal  [Select][+][-]
  1. ShellExecuteA(0,PAnsiChar('open'),'calc','','',SW_SHOW);
  2. ShellExecuteA(0,PAnsiChar('open'),'notepad','','',SW_SHOW);
  3.  
or even
Code: Pascal  [Select][+][-]
  1. ShellExecuteA(0,PAnsiChar('open'),'index.html','','',SW_SHOW);
  2.  
calls defaukt WWW browser.
How do it independent from Windsows/Linux and other?

Hartmut

  • Hero Member
  • *****
  • Posts: 742
Re: Portable opening (default) applications
« Reply #1 on: January 28, 2020, 12:30:18 pm »
To open a document/file with the default viewer/editor registered with the operating system for that file/file extension you can use OpenDocument() = https://wiki.freepascal.org/opendocument

To open an URL with the default/registered web browser as specified by the operating system you can use OpenURL() = https://wiki.freepascal.org/openurl

 

TinyPortal © 2005-2018