Question about a coding a picture viewer

Started by
0 comments, last by Puffy_Taco 19 years, 8 months ago
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
Advertisement
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.

This topic is closed to new replies.

Advertisement