[fpc-pascal] File Association and opening with already running app

Graeme Geldenhuys graeme at geldenhuys.co.uk
Thu Apr 4 11:08:07 CEST 2013


Hi,

I'm posting it here, but it is not a Lazarus question, but a general GUI
app (created with FPC) question.

Example of what I want to achieve. Say I have gEdit (Gnome editor) open
and have a file loaded. Now if I am in a console and type 'gedit
someotherfile.txt' [or double click a text file in Nautilus], it doesn't
start a new instance of gedit, the existing instance opens the new file
- gedit supports multiple opened files in a tabbed view.

How do they accomplish this? I would like to implement something like
that for fpGUI, and it must work under all fpGUI supported "desktop"
platforms.

I know under Windows you can check if an instance of an application is
already running, and stop your current instance. Still not sure how to
transfer the "open a new file" action to that existing instance.

As for Linux, FreeBSD etc, I have no clue how to do it. For those not in
the know, fpGUI is based directly on GDI or XLib (not Qt, GTK etc).



Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/




More information about the fpc-pascal mailing list