Getting Open With to work for my application? (Win32)

Started by
5 comments, last by ajm113 15 years, 10 months ago
So how can "Open With" pass in the file location into my app to load in Win32 or perhaps when the user opens the file my app will load up with that file location passed in. Then my application will load that file with the location passed in. I tried Google and I couldn't find much.. Win32/C++ VS2005 STD - Windows xp/Vis
Check out my open source code projects/libraries! My Homepage You may learn something.
Advertisement
Looks like when the shell executes a program in the Open With list it calls the Open verb on the application. Register that verb and you should be good to go.
That link still doesn't quite answers my question that well, sorry. I know I am supposed to go in regedit and find the ext, but how do I set up my app for Reg and how do I go in my app or in reg to tell what information goes where when the file is opened?
Check out my open source code projects/libraries! My Homepage You may learn something.
Look at the related documentation. For example, About File Extensions. A simple search on the MSDN for verbs will net you this link about setting up verbs for your app.
I set up a .slf key in ROOT area directorys set up like so:

.slf
shell
open
command - Default = "C:\Documents and Settings\username\Desktop\ShawarmaLanguage\debug\ap.exe" %*

but it doesn't seem to have a effect as a test. I did restart my pc...
Check out my open source code projects/libraries! My Homepage You may learn something.
By ROOT area I assume you mean the key is in HKEY_CLASSES_ROOT? If so then your key is still incorrect in one part: change the value of default from

"C:\Documents and Settings\username\Desktop\ShawarmaLanguage\debug\ap.exe" %*

to

"C:\Documents and Settings\username\Desktop\ShawarmaLanguage\debug\ap.exe" "%1"

and ensure that your program will accept a filename from its command line arguments.
[edit]
Ok, I got the command line args working fine. I did a test through VS2005 using a path to the file and it works perfectly.

It still seems that the reg edit is still having no effect with the file ext... Is their anything else I can do for you to help me out?

[Edited by - ajm113 on June 14, 2008 5:31:59 AM]
Check out my open source code projects/libraries! My Homepage You may learn something.

This topic is closed to new replies.

Advertisement