Open C++ program with an external file

Howdy :)

I am pretty much a beginner, and this is my first post. I am working on an encryption program that prompts a user to enter a password when they try to open a certain assigned file outside of the C++ main file, solution, or executable. Any idea on how to work this out? It would be cool if someone told me which library file this can be done with.

'preciates this ^___^
To get data from the user you can use getline(), and to open a file you can use an fstream.
yo firedraco, that is cool thanks for the reply.

What if I needed to open the C++ program/password prompt by opening the file? Instead of the opposite. This is probably unorthodox, but I believe it can be done.

:D
On Windows, you can modify the registry so that some file extensions launch your program when you open them
thanks BZ, i searched plenty sites for help on modifying a file's registry. Are you talking about changing all files' (with that extentsion) association (all ".txt)"? I was trying to do this for a single file... preciate it :3
I think would better creating your own extension, all files with that extension are for default open with your program (Notice that the user can open them manually with other programs)

You can create your own extension also programmatically using Windows API
Topic archived. No new replies allowed.