[fpc-pascal] Adding command line parameter to GUI application?

Bo Berglund bo.berglund at gmail.com
Wed Feb 26 01:16:41 CET 2025


On Tue, 25 Feb 2025 22:47:29 +0100, Tomas Hajny via fpc-pascal
<fpc-pascal at lists.freepascal.org> wrote:

>On 2025-02-25 22:09, Jean SUZINEAU via fpc-pascal wrote:
>> I haven't done it recently but basically on Windows you have keys in
>> the registry under HKEY_CLASSES_ROOT to associate your program with a
>> specific file extension.
>> 
>> You can view the registry with regedit.

I need it to be for all recognized video extensions....

>  .
>
>I'd add that you can define the association either using an installer 
>used to install your program on the PC, or you can do it manually 
>without any installer - the latter may be done in two ways, the first 
>being right clicking a file with the extension you intend to associate 
>to your program, selecting "Open with" from the context menu, then 
>selecting "Choosing app on your PC" at the bottom and then selecting the 
>"Always" button after finding the path to your program; the second being 
>using the Settings dialog -> Apps -> Default apps -> Choose defaults by 
>file type and then again "Choosing app on your PC" at the bottom.
>
>Tomas

So I have now added the new feature to the application and tested it by
launching it from a command window and it works as I wanted.
However it is NOT "installed" in Windows since I am developing it here and I
want it to be associated not with a single video file type (mp4 for example) but
for all video file types that VLC supports (basically everything there is).

When I right clicked a video file and selected "Open With" my application was
not listed among the suggestions.
But after using a very dim link below the known applications I waqs able to
navigate to my application (which is on path) and start it.

And after this was done my application is actually among thoise that are listed
for video fiiles but under anotyher name: "Video editor using VLC engine"

How that happend is nothing I know, but it does work now.
It is not the default one but it is listed among the possibilities at least.
So I have to right-click instead od doubleclick it to start and then select
"Open With".

But finally:
If I open Settings and go to default apps and select Video I see my app listed
among the candidates!

So I could in fact set it to be the default for videos in general!  :-)

Case closed and I do have a more useful configuration now!


-- 
Bo Berglund
Developer in Sweden



More information about the fpc-pascal mailing list