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

 
Question about getting my program run as deafult

Pages: 12
May 14, 2012 at 4:33pm
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 May 14, 2012 at 4:33pm
May 14, 2012 at 11:02pm
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.
May 15, 2012 at 11:11am
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?
May 15, 2012 at 12:08pm
The WinAPI probably provides a function for that, look it up at msdn.com
May 15, 2012 at 2:06pm
It's probably a registry key, you could just have the program add a line to registry.
May 15, 2012 at 3:04pm
Last edited on May 15, 2012 at 3:05pm
May 16, 2012 at 9:55pm
Everyone keeps posting windows references, but what about *nix and Mac? This is an issue that spans all OS and not just one.
May 16, 2012 at 10:44pm
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.
May 16, 2012 at 11:41pm
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 May 17, 2012 at 12:29am by closed account z6A9GNh0
May 18, 2012 at 9:36pm
@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.
May 18, 2012 at 11:47pm
Sad that I didn't know that and I've been using Ubuntu for 2 years now.
May 19, 2012 at 9:39am
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).
May 19, 2012 at 12:06pm
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)
May 19, 2012 at 12:11pm
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?
May 19, 2012 at 12:20pm
Because you may not remember the command
By instance decompressing files.
May 19, 2012 at 12:55pm
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.
May 19, 2012 at 1:12pm
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.
May 19, 2012 at 1:15pm
¿what you mean with "quickstart mechanism"?
May 19, 2012 at 4:02pm
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.
May 19, 2012 at 7:08pm
Desktop shortcuts?
Pages: 12