File Type Associations

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
OwnZ joO




Articulatist 500

Posts: 980
Joined: Thu Nov 10, 2005 4:24 pm

File Type Associations

Post by OwnZ joO »

I made a program to edit the File Associations in windows. I know this can be done using tools > folder options, but I just noticed that the programmers on here tend to do it in a weird way(still works good). I'm just releasing this and the source for anyone that wants to to learn from it. It's really heavily commented, so more experienced programmers might get annoyed by that(I really over-explained things for beginners)

This allows you to select multiple programs for a file extension to use in opening them. You can change the File Type that windows displays ex: .txt files are text files. The first program you add will be the default double click shell handler(open with a right click), and the rest will be put in as Open with Application Name. These are pictures of it working.

Image

Image
Attachments
FileTypeAssociation.zip
File Type Associations EXE
(5.57 KiB) Downloaded 15 times
FileTypeAssociation_src.zip
File Type Associations Source
C#.net 2005
(18.18 KiB) Downloaded 16 times
User avatar
xzodia




Translator Connoisseur Coagulator

Posts: 1981
Joined: Sun May 15, 2005 10:31 am
Location: UK
Contact:

Post by xzodia »

thats pritty cool but the ui could use some work :P
Image
Halo 2 Plugins | Lock-on To Just About Anything | My Sites | Snow Hog
Old Plugins you have, upgrade you must...
Always Maintain a High Quality-To-Crap Ratio.
User avatar
StalkingGrunt911




Recreator Connoisseur Acolyte Coroner
Sigma Pyre

Posts: 3618
Joined: Wed May 24, 2006 12:30 pm
Location: Florida!
Contact:

Post by StalkingGrunt911 »

That's pretty cool, good job.
-DeToX-




Illusionist Recreator Connoisseur Acolyte
Sigma Decryptor Droplet Pyre
Blacksmith Socialist New Age System Engineer
ONI

Posts: 4589
Joined: Sun Jun 18, 2006 3:58 pm
Location: ...

Post by -DeToX- »

UI makes me want to kill myself. Other than that nice job :wink:
Image
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

Posts: 1026
Joined: Wed Dec 27, 2006 6:49 am
Location: UK
Contact:

Re: File Type Associations

Post by Prey »

Prey - A Programmers Reference wrote:The Vision
This is where it all starts, the idea. A short sentence or small paragraph, it is what will drive you during the course of development on your new program, and is one of the most important parts of the development cycle.

[...]

Now let me quickly list 2 very important don'ts:
  • [...]
  • If your idea has already been realized in some sort of other application, you should not continue unless you honestly feel that the job could have been done better. In the case of a calculator, theres no point in making it if the eventual result is not going to be better than the one Windows comes with for free.
OwnZ joO wrote:[...] I know this can be done using tools > folder options [...]
I see no improvement >_>

As for the source code, I had a quick look over it.. you need to cut back on the regions man, and it is way too heavily coded to be honest. Also you forget to call the .Close() on the regkey once your done with it >_>
Halo 2 Prophet - Skin with ease with the simple 3D point and click interface.
Halo 3 Research Thread - Contribute to the research into Halo 3.
User avatar
Tural




Conceptionist Acolyte Bloodhound Recreator
Socialist Connoisseur Droplet Scorched Earth
Grunge

Posts: 15628
Joined: Thu Jun 16, 2005 3:44 pm
Location: Lincoln, NE
Contact:

Post by Tural »

This man speaks the truth.
OwnZ joO




Articulatist 500

Posts: 980
Joined: Thu Nov 10, 2005 4:24 pm

Re: File Type Associations

Post by OwnZ joO »

-DeToX- wrote:UI makes me want to kill myself. Other than that nice job :wink:
Yeah, this wasn't meant to be a huge project, you have access to the source code, change what you don't like :lol:
Prey wrote:
Prey - A Programmers Reference wrote:The Vision
This is where it all starts, the idea. A short sentence or small paragraph, it is what will drive you during the course of development on your new program, and is one of the most important parts of the development cycle.

[...]

Now let me quickly list 2 very important don'ts:
  • [...]
  • If your idea has already been realized in some sort of other application, you should not continue unless you honestly feel that the job could have been done better. In the case of a calculator, theres no point in making it if the eventual result is not going to be better than the one Windows comes with for free.
OwnZ joO wrote:[...] I know this can be done using tools > folder options [...]
I see no improvement >_>

As for the source code, I had a quick look over it.. you need to cut back on the regions man, and it is way too heavily coded to be honest. Also you forget to call the .Close() on the regkey once your done with it >_>
I didn't do it to improve on the fold options, it was as an example for other people wanting to program file associations. If I was trying to just make a better version, I wouldn't have released overly commented source code. Also a lot of people on here probably only have one default program for map file, I'm sure you have thought of this already, but not everyone on this site is as crafty with computers as a programmer, I guess I could have done a tutorial on just using folder options to change it, but then people wouldn't get the code examples.

I know I coded heavily, but error catching without try catch blocks is good, you're really only supposed to use those when you can't know if there will be an error or not like in an IO situation.
User avatar
DrXThirst




Connoisseur Foundry Pyre

Posts: 3011
Joined: Fri Jun 29, 2007 6:28 am
Location: Georgia
Contact:

Post by DrXThirst »

Well, I updated the UI a little. It's ok I guess. Better than the original?


Image
Image
User avatar
Tural




Conceptionist Acolyte Bloodhound Recreator
Socialist Connoisseur Droplet Scorched Earth
Grunge

Posts: 15628
Joined: Thu Jun 16, 2005 3:44 pm
Location: Lincoln, NE
Contact:

Post by Tural »

Get rid of all that empty space.
User avatar
DrXThirst




Connoisseur Foundry Pyre

Posts: 3011
Joined: Fri Jun 29, 2007 6:28 am
Location: Georgia
Contact:

Post by DrXThirst »

Alright, better?

Image

*I also moved the save button to the top right hand corner.
Attachments
FileTypeAssociation.rar
The app
(11.56 KiB) Downloaded 8 times
Last edited by DrXThirst on Fri Sep 14, 2007 12:45 pm, edited 1 time in total.
Image
User avatar
Tural




Conceptionist Acolyte Bloodhound Recreator
Socialist Connoisseur Droplet Scorched Earth
Grunge

Posts: 15628
Joined: Thu Jun 16, 2005 3:44 pm
Location: Lincoln, NE
Contact:

Post by Tural »

Indeed, 'tis better.
User avatar
DrXThirst




Connoisseur Foundry Pyre

Posts: 3011
Joined: Fri Jun 29, 2007 6:28 am
Location: Georgia
Contact:

Post by DrXThirst »

Alright. Thanks. I also attached the app to the post above. The icon is horrible, however, I know of no where with good icons.
Image
User avatar
Tural




Conceptionist Acolyte Bloodhound Recreator
Socialist Connoisseur Droplet Scorched Earth
Grunge

Posts: 15628
Joined: Thu Jun 16, 2005 3:44 pm
Location: Lincoln, NE
Contact:

Post by Tural »

User avatar
DrXThirst




Connoisseur Foundry Pyre

Posts: 3011
Joined: Fri Jun 29, 2007 6:28 am
Location: Georgia
Contact:

Post by DrXThirst »

Cool! Thanks.

Also, I added a MUCH better icon and included the source. Both are attached to this post.
Attachments
FileTypeAssociation_src.rar
File Type Association : Source
(344.99 KiB) Downloaded 6 times
FileTypeAssociation.rar
File Type Association : Application
(102.53 KiB) Downloaded 11 times
Image
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

Posts: 1026
Joined: Wed Dec 27, 2006 6:49 am
Location: UK
Contact:

Post by Prey »

Meh, I don't think your UI looks much better, more confusing if anything. Nice icon though.

I remember making something like this a long time ago...and I remember the reason being the Windows one didn't (and still doesn't) let you resize >_> ... I just sourced it out now actually:

Image

Woo for Alex Corporation! You know me as Prey, and so I put the name Prey in my applications...but my personal stuff gets the better treatment :P ..anyway I got bored making it pretty quickly I remember, hence the lack of anything in the 'actions' box ^__^
Halo 2 Prophet - Skin with ease with the simple 3D point and click interface.
Halo 3 Research Thread - Contribute to the research into Halo 3.
User avatar
DrXThirst




Connoisseur Foundry Pyre

Posts: 3011
Joined: Fri Jun 29, 2007 6:28 am
Location: Georgia
Contact:

Post by DrXThirst »

Are you going to release it? I like it!
Image
OwnZ joO




Articulatist 500

Posts: 980
Joined: Thu Nov 10, 2005 4:24 pm

Post by OwnZ joO »

Prey wrote:Meh, I don't think your UI looks much better, more confusing if anything. Nice icon though.

I remember making something like this a long time ago...and I remember the reason being the Windows one didn't (and still doesn't) let you resize >_> ... I just sourced it out now actually:

Image

Woo for Alex Corporation! You know me as Prey, and so I put the name Prey in my applications...but my personal stuff gets the better treatment :P ..anyway I got bored making it pretty quickly I remember, hence the lack of anything in the 'actions' box ^__^
Looks pretty professional, why would you need to resize it though?
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

Posts: 1026
Joined: Wed Dec 27, 2006 6:49 am
Location: UK
Contact:

Post by Prey »

Because it annoyed me that you had to scroll through all those filetypes in such a small box. A filter would probably have worked better actually now that I think about it...oh well. And no I won't be releasing; it doesn't do much remember ;x
Halo 2 Prophet - Skin with ease with the simple 3D point and click interface.
Halo 3 Research Thread - Contribute to the research into Halo 3.
User avatar
StalkingGrunt911




Recreator Connoisseur Acolyte Coroner
Sigma Pyre

Posts: 3618
Joined: Wed May 24, 2006 12:30 pm
Location: Florida!
Contact:

Post by StalkingGrunt911 »

Prey wrote:Because it annoyed me that you had to scroll through all those filetypes in such a small box. A filter would probably have worked better actually now that I think about it...oh well. And no I won't be releasing; it doesn't do much remember ;x
Then program it to do much "Perfectionist". :P :wink:
OwnZ joO




Articulatist 500

Posts: 980
Joined: Thu Nov 10, 2005 4:24 pm

Post by OwnZ joO »

Prey wrote:Because it annoyed me that you had to scroll through all those filetypes in such a small box. A filter would probably have worked better actually now that I think about it...oh well. And no I won't be releasing; it doesn't do much remember ;x
On the it doesn't do much regard, I know that this doesn't improve on functionality of the windows one, but a lot of people don't know about it, or don't know how to do it. If I just released the app and no source, then that would be fine to call me out on, but I just did it as an example for anyone interested in it.
Post Reply