Sign in to follow this  
Chrysaor

Question about a coding a picture viewer

Recommended Posts

Hi, I'm planning on making a picture viewer. I save my pictures in a simple file format, cuts out all the excess info i dont need and makes loading them easier. The actual code to display the picture and all that isnt the problem though. My question concerns the opening of the file. See, i want to be able to simple click on the file and it will open in my picture viewer. I know you can set windows to open said file with whichever program you want, but what i want to know is, how do i let the program know which file to load. Is the file path with the file name sent to the program? I hope I'm clear as to what I wanna know. The program has to have a way to know which file to load, the filename has to be sent to the program somehow, right? Thanks for the help whomever replies

Share this post


Link to post
Share on other sites
The file name will be the first (well, second after the exe path) argument sent to the program. Just check for this argument, and you'll have the picture's file name. You can modify this by going to Folder Options under the tools menu of Windows Explorer. Then go to the file types tab. Clicking a standard file, like TXT, and doing advanced, you'll see how data is sent. You can of course change this also. Or by going to the registry (HKEY_CLASSES_ROOT), you can see how other programs have registered their file types in the registry. Some programs use DDE, but I'm not familiar with this, so you'd have to look it up. I don't think you will need it, though.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this