This week's book giveaway is in the Other Open Source APIs forum. We're giving away four copies of Storm Applied and have Sean Allen, Peter Pathirana & Matthew Jankowski on-line! See this thread for details.
Hi, i've made a nice little program that has its own file extention in regards to saving and loading files (just converted ints to bytes etc...)
What i would like to do is have that file-type display a custom icon. I heard somewhere that to deploy this to other computers (including my own) i would need to create and check regestry information for this icon.
This is new teritory for me, making applications (guis and what not) is one thing but i havent even toutched regestry editing before.
Is it even possable? and could someone give me alot of help with it please?
You can configure a custom icon by adding a DefaultIcon entry to the proper entry under HKEY_CLASSES_ROOT. The best way to do this is to follow an existing example. As an example, running redgedit I can see that the .zip extension is mapped to WinZip:
and that WinZip uses icon #2 packaged within winzip32.exe:
This redirection from .zip to WinZip allows many extensions (.tar, .gz, etc.) to use the same base configuration information. You could also place the DefaultIcon entry directory below the extension (that is, under .zip in this example). Also, it is not necessary to bury the icon in an EXE file, you could reference your .ico file directly.
Once you have it set up on your PC, extracting the registry entry as a .reg file and "executing" it as part of your install should work.
Of course, this is the manual way to do things. Most Windows installers provide functionality to automate this.