[Lazarus] Cross platform 'open file with default program'

cobines cobines at gmail.com
Sun Jan 24 20:57:59 CET 2010


2010/1/24 Juha Manninen <juha.manninen at phnet.fi>:
> One thing is missing though. There is no portable way of getting application's
> icon like ExtractAssociatedIcon does in Windows? This is somewhat related to
> opening the file.
> I asked about it some time ago in FPC mailing list and didn't get answers, so
> I guess there is no such function. Does anyone have an idea about how to
> implement it (except for Windows)?

You can use freedesktop.org standards in Linux:
- shared-mime-info
(http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html)
to get MIME type of file
- icon-theme (http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html)
to get icon for the MIME type

I'm not aware of any implementations in pascal.

--
cobines




More information about the Lazarus mailing list