Skip to main content
GameDev.net gamedev.net
🔒 Locked

File type associations

Started by darkchrono4 May 25, 2003 at 11:57 PM 5 replies 350+ views
Original Post
darkchrono4
darkchrono4
I know how to edit the registry to be able to double click a file type and make it start a program. But how do I get the program to take an action with the file? Say I have a map type. When its double clicked how do I get the program to automatically open the map up and display it?
billybob
billybob
its in the command line
Mulligan
Mulligan
Right click on the start menu, click on Explore. Then under the View menu, click Folder Options. Then under the File Types tab, find the file type you want (or create a new one). Whamo.
darkchrono4
darkchrono4
When I use GetCommandLine after starting the app with my associated file all I get is the path to the exe. But if I create a shortcut and give it an arguement I get that arguement in GetCommandLine. Any suggestions?
darkchrono4
darkchrono4
Somebody else has had to have done this in the past. I''m not having any luck at all. Even checking the WinMain string that has the command line doesn''t give me the name of the file if I start the app by double clicking on one of my associated files.
Interim
Interim
Usually the file is passed as a paramater to the command line of the program?

If you properly register it with the registry, it''ll use the file that was "double clicked" as the substituted %1 in the registry entry..?

Maybe I misunderstand your question. From there, it''s upto your program to open the file, read it in and do whatever you want with it.

Interim
darkchrono4
darkchrono4
Yeah, I didn''t know I had to have the %1 for it to pick up the file as an arguement. Thanks.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.