making your game files 'doubleclickable'

Started by
8 comments, last by billybob 21 years, 8 months ago
i want to make it so my level files can be doubleclicked, and it loads the editor with that level. how do i do that.
Advertisement
I''ve never done it but I think you need to connect the filetype with the program(your level editor). I

f you open it the first time windows ask which program you want to use to open it and you can check the box to always use that program..

Maybe they set a parameter in the register.
Another way to do it is to open up any old folder, and go to Tools->Folder Options...->File Types. From here you can associate (and unassociate) file types with applications. After you have done this, goto the View tab and click "Like Current Folder". And you''re done!
Yeah, just use the file association tools (for your own comp). If you want this to be done when the game installs, you''ll need to modify the Windows registry.
Use the windows registry ....

Metal Typhoon
Metal Typhoon
It''s fairly easy, use the registry, under HKEY_CLASSES_ROOT. Here''s an MSDN article about it.
no not that part, in my program, how would i make it know to load the level after a game file was doubleclicked. right now, it just launches the editor but doesn''t load the file.
You mean in your editor, you click on Open and want to load the file? If that''s what you mean I don''t see the problem. There''s API functions to do a Open/Save dialog, GetOpenFileName() & GetSaveFileName().

Otherwise I don''t understand your problem.


Read about my game, project #1
NEW (13th August): A new screenshot is up, plus diaries for week #3

John 3:16
I would assume it passes the filename eg "C:/Program files/myLevel.lvl" in as the command line...

CEO Platoon Studios
[email=esheppard@gmail.com]esheppard@gmail.com[/email]
The filename is passed in the command line parameters.

If you are using win32api its located in WinMain() parameters.
If you are using MFC, there is a CWinApp method for that, I don''t remember the name sorry, probably CWinApp::CommandLine.

Take a look at MSDN.
Editor42 ...builds worlds

This topic is closed to new replies.

Advertisement