• Forum
  • Lounge
  • Question about getting my program run as

 
Question about getting my program run as deafult

Pages: 12
Hi,
Do anybody know how can I make my program run when opening files with certain extension? I mean, if you know any Setup Compiler such as Inno supports it or even if you know how to make it with C/C++ code or something I'd like to know. Cheers.
Last edited on
In Windows 7, I go to Control Panel -> Default Programs -> Associate a file type or extension with a program -> the extension you are looking for and you can adjust the program that is run by default.
I know how to change it myslef but my question is how can I make my program *automaticly* the deafult program for let's say .txt files?
The WinAPI probably provides a function for that, look it up at msdn.com
It's probably a registry key, you could just have the program add a line to registry.
Last edited on
Everyone keeps posting windows references, but what about *nix and Mac? This is an issue that spans all OS and not just one.
Because the issue is something rather windows specific. Not in the way that it can't be done in other OS'es, but in the way that people want it less in other OS'es. Also, he mentioned using Inno which is Windows only IIRC.
but in the way that people want it less in other OS'es.

Unless you are a programmer that makes a editor and want your file types to autorun the editor to edit them (like an IDE or something):P. I think it would be beneficial to show (in a new thread as to not derail this one) how to do it in other OSes for those who do make applications like a simple editor for text or game editor or such that wants to have the file auto launch their program. Just my opinion though.
Last edited on by closed account z6A9GNh0
@BHXSpecter
It would likely be specific to the window environment (Gnome, KDE, XFCE, etc..), also iirc linux bases file associations on mime type not file extension.
Sad that I didn't know that and I've been using Ubuntu for 2 years now.
Although in turn, file extensions are used to determine the MIME type (not ONLY the file extension like windows does, but it's a considered factor).
Apparently I need to look into Ubuntu more in this regard. Not sure what to search for though. For if I make my own map editor for a game or a program that auto launches for a file I make.

The day I stop learning is the day you can bury me in the ground because I'll be dead :). (sorry for the morose comment)
http://developer.gnome.org/integration-guide/stable/mime.html.en

I still don't think that's something you need to be focusing on - what's wrong with just starting the editor first and then loading the file from there?
Because you may not remember the command
By instance decompressing files.
I still don't think that's something you need to be focusing on - what's wrong with just starting the editor first and then loading the file from there?

Well on my computer I agree, but if I'm making an application that I'd like to put out for others to use it would be nice to let them have an auto launch capability as not all *nix users are programmers so they may use the GUI more than command. I'm half and half, use commands when I need to otherwise I use the GUI.
Is there a *nix environment that doesn't have some sort of quickstart mechanism for this sort of thing? I personally am always VERY annoyed by programs making changes to the system I didn't ask them to do, that's why I'm asking.
¿what you mean with "quickstart mechanism"?
I couldn't think of a word that describes the concept - putting a link on desktop, or the app-list-whats-it-called-thingy in Unity, something like the windows start menu, etc. Those kinda things.
Desktop shortcuts?
Pages: 12