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

2010-01-24 Thread Luiz Americo Pereira Camara
Juha Manninen escreveu: Hello. Under Linux with distros supporting the freedesktop.org standards you can execute the 'xdg-open' command. This will use the mime-type and the each users preference on that system. This works for URL's too. Great! For Windows you can use a wrapper for She

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

2010-01-24 Thread cobines
2010/1/24 Juha Manninen : > 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 the

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

2010-01-24 Thread dmitry boyarintsev
On Sun, Jan 24, 2010 at 2:08 PM, Juha Manninen wrote: > 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. It depends on what you exactly need. If you need just to get an

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

2010-01-24 Thread Juha Manninen
Amazing, OpenURL already implements what you are asking! I tested with a local '.patch' file and it opened nicely in Kompare (KDE prog for diffs). OpenURL uses ShellExecuteW for Windows, 'xdg-open' for *nix and some API functions for Darwin. There seems to be lots of quality code in FPC/Lazaru

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

2010-01-24 Thread Luiz Americo Pereira Camara
Graeme Geldenhuys escreveu: 2010/1/24 Juha Manninen : This should be included in FPC/Lazarus libraries, but which one? I know that Lazarus IDE already uses xdg-open under Linux for OpenURL - before trying other known web browsers. As for where in LCL such code should go, I have no idea

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

2010-01-24 Thread Graeme Geldenhuys
2010/1/24 Juha Manninen : > If OSX supports your 'xdg-open' then most environments are covered. I doubt it will. As far as I know xdg tools are for Linux only (maybe other unix OSes too, but ain't sure). > This makes sense only with GUI. Command line progs can't use it. There are other scripts f

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

2010-01-24 Thread dmitry boyarintsev
On Sun, Jan 24, 2010 at 12:05 PM, Juha Manninen wrote: > If OSX supports your 'xdg-open' then most environments are covered. It doesn't, by default. There's an external tool 'open' available for such task. But, it's better to use launcher API (see OpenURL darwin code). thanks, dmitry -- ___

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

2010-01-24 Thread Juha Manninen
Hello. > Under Linux with distros supporting the freedesktop.org standards you > can execute the 'xdg-open' command. This will use the mime-type and > the each users preference on that system. This works for URL's too. Great! For Windows you can use a wrapper for ShellExecute function. I copied

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

2010-01-23 Thread Graeme Geldenhuys
2010/1/24 Luiz Americo Pereira Camara : > Does someone implemented a  function to open the system default app > associated of a given file type? Similar to OpenURL? Under Linux with distros supporting the freedesktop.org standards you can execute the 'xdg-open' command. This will use the mime-type

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

2010-01-23 Thread Luiz Americo Pereira Camara
Does someone implemented a function to open the system default app associated of a given file type? Similar to OpenURL? Luiz -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus