It's pretty easy to find a solution. Why did not you do it so far, just looking at Registry and using Google? Any particular problem?
For example, you will find explanation and further references here: http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/d89af73d-3ad7-485a-b6c4-94dadf13659e/
Please see my comment below. Your changes in the Registry only provides the Shell with relevant information. It effects the use of related API in the code. In particular, use can simply call:
Can you see? The application is not specified, just the data file. Nevertheless, as the Shell is involved here, it will find out the data about processing of "*.txt" files and will start your application as
(with full path name of the application, of course).
However, you will need one more thing: you application should process command line and load the file according to it. If you did not do it so far, it won't work.
For processing of command line, you can use a comprehensive solution I offer in my article (don't worry, easy to use): Enumeration-based Command Line Utility
]. There is a reference to one more solution in my article's text.