How to open file in own program?
-
Hi, I have a file that i want to associate it with my program. Then, if i double click it in explorer, it should automatically open in my program. What event should i handle? How to do this? Usman
-
Hi, I have a file that i want to associate it with my program. Then, if i double click it in explorer, it should automatically open in my program. What event should i handle? How to do this? Usman
uus99 wrote:
I have a file that i want to associate it with my program. Then, if i double click it in explorer, it should automatically open in my program.
you have to associate the file extention with your program... for that you have to change entry in HKEY_CLASSES_ROOT in registry
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV
-
uus99 wrote:
I have a file that i want to associate it with my program. Then, if i double click it in explorer, it should automatically open in my program.
you have to associate the file extention with your program... for that you have to change entry in HKEY_CLASSES_ROOT in registry
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV
Hi, once i associate the the file extension, which function will be called if i open the file in explorer? I mean, for example, my program is Program.exe, and the file is file.zzz. I associate the files *.zzz to my program, and if i open it in explorer, which function in my program will it be called?? OnOpen() etc?? Do i have to add an event handler? THanks, Usman
-
Hi, once i associate the the file extension, which function will be called if i open the file in explorer? I mean, for example, my program is Program.exe, and the file is file.zzz. I associate the files *.zzz to my program, and if i open it in explorer, which function in my program will it be called?? OnOpen() etc?? Do i have to add an event handler? THanks, Usman
:doh::sigh:
uus99 wrote:
if i open it in explorer, which function in my program will it be called?? OnOpen() etc?? Do i have to add an event handler
If you have created SDI/MDI based application, Document/view architecture will handle it for you! you have to overide OnOpen Function (I forget the actual Handller or Function :doh::sigh:)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV
-
Hi, once i associate the the file extension, which function will be called if i open the file in explorer? I mean, for example, my program is Program.exe, and the file is file.zzz. I associate the files *.zzz to my program, and if i open it in explorer, which function in my program will it be called?? OnOpen() etc?? Do i have to add an event handler? THanks, Usman
To complete the answer of Alok, in fact what really happen is that your program is called with the name of the file passed as command line argument. But, like Alok said, if it is a SDI or MDI app, the framework will handle all the job for you (it will call automatically the serialize methods thus loading the file). But of course, you have to implement the loading,saving of data in the serialize handlers.
-
Hi, I have a file that i want to associate it with my program. Then, if i double click it in explorer, it should automatically open in my program. What event should i handle? How to do this? Usman
-
To complete the answer of Alok, in fact what really happen is that your program is called with the name of the file passed as command line argument. But, like Alok said, if it is a SDI or MDI app, the framework will handle all the job for you (it will call automatically the serialize methods thus loading the file). But of course, you have to implement the loading,saving of data in the serialize handlers.