I'm trying to build a program that will open a custom file format. I was wondering if there was a way to open the file with the program like how you can open a .txt by clicking open on the file in windows and linux.
I'm not sure how to do it, but I'd recommend switching to a custom file extension. If you give a user the program and they install it, they might get pissed that they see the option for every single text file.
The txt was an example, im using akfw and akfa.
On windows, it requires writing values to the registry (HKEY_CLASSES_ROOT has the information). I'm not sure about Linux, but it is probably a file somewhere.
Thank, but how does the program know what file you are running it from.
The file name is passed on the command-line. For instance, in Windows, you specify the command to run when opening a file (located in the registry).
This is an example using my mapping for a Visual Studio .sln file. It will run:
"C:\Program Files\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe" "%1"
The '%1' gets replaced with the file that the user opened.
cool thanks!