Well as undeadlord suggested that would be the best course of action. This can be done on a one time basis. meaning that when you do the steps undeadlord outlined thier is also a check box that says "always use this program to open this file" check that and then it will always open that with that program from then on out.
How to program it. I am not sure. File extensions are usally set with the software that the files were created in.
If you wrote your own program to have files opened with extension abc why didn't you just use the standard txt file format if in reality that is what it is. a text file.