Omg.. its been a while since i did stuff like this.. eehhmm..
the solution is not in your program, its in the Reg if im correct.
Whats your key, shell set as? Its should be something like this:
(Say its a text file)
HKEY_CLASSES_ROOT\txtfile\shell\"Open This.. " (Or whatever the key)
Then have the sub keys in "Open This.. " as:
command and ddeexec.. so you have those 2.
Make the Value in the "command" as the route to your program:
"C:\Documents and Settings\Sketch\Desktop\TEST.exe"
but then at the end add "%1" so you get:
"C:\Documents and Settings\Sketch\Desktop\TEST.exe""%1"
Make the ddeexec Value as: Open("%1")
Now, in the key ddeexec add to more: application and topic
In application give the app name (I think thats correct)
Then in topic put: system
Now i haven't done this for ages so i could be wrong on some parts, but i think thats the basic jist of it. Try it out