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

2025-02-25 Thread Bo Berglund via fpc-pascal
On Tue, 25 Feb 2025 22:47:29 +0100, Tomas Hajny via fpc-pascal
 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

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2025-02-25 Thread Tomas Hajny via fpc-pascal

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'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
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2025-02-25 Thread Jean SUZINEAU via fpc-pascal
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.

Your application is called with the filename as parameter on the command 
line.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2025-02-25 Thread Luca Olivetti via fpc-pascal

El 25/2/25 a les 21:28, Bo Berglund via fpc-pascal ha escrit:


I want the program to load a video file if it appears in the command line so it
can be immediately played rather than having to click the OpenFile button and
navigate to the video and select it.

Any ideas, suggestions, links?


https://www.freepascal.org/docs-html/rtl/system/paramcount.html
https://www.freepascal.org/docs-html/fcl/custapp/tcustomapplication.getoptionvalue.html

(read also the "See also" section)

Bye
--
Luca

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2025-02-25 Thread Bo Berglund via fpc-pascal
I have created a Video Player application to be used in order to create the
ffmpeg command to edit a video file according to cut points evaluated inside the
program. I have used the PasLibVLC library for the video handling.

But I have found that it is also useful as a regular video player where I have
added useful functions also good for viewing.

The application loads paramaters from an ini file on start where for instance
the default form size video step values and last used video file etc are read
from the ini file.

Now I want to use this application as a regular video player too, i.e. I want to
be able to click on a video file in Windows File Explorer and start my
application with the video file name as a command line paramater.

How can this be done with my application not intended from the start to be used
this way?

And how can I register it as a possible Video player such that it will be shown
in the list of apps to play a selected video file?

The current start state is a form with some edit controls and a display area
where control values are read from the ini file but once populated the
application waits for user input.

I want the program to load a video file if it appears in the command line so it
can be immediately played rather than having to click the OpenFile button and
navigate to the video and select it.

Any ideas, suggestions, links?


-- 
Bo Berglund
Developer in Sweden

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal