Load Application from persisted file

  • Thread starter Thread starter Suresh Mani
  • Start date Start date
S

Suresh Mani

Hello,

I am developing a MDI application. I am saving the application state into a
file.

How can i launch my application, on double clicking the the file in c#.

Thanks in Advance.
Suresh Mani
 
You can add some registry keys, let say your program file name is
C:\MyProj\Abc.exe and file extension is .abc

Now follow these steps-

Create key "HKEY_CLASSES_ROOT\.abc"
Set default value to AbcFile

Create key "HKEY_CLASSES_ROOT\AbcFile"
Set default value to the type description some description

Create key HKEY_CLASSES_ROOT\AbcFile\DefaultIcon
Set default value to something like "C:\MyProj\abc.exe,2"

Create key "HKEY_CLASSES_ROOT\AbcFile\Shell\Open\Command"
Set value to open command: "C:\MyProj\abc.exe %1"

There are some other option to see the registry values for commonly used
files like .doc, .txt etc.

You can create these through setup program like install shield or by your
own executable (abc.exe) when it execute first time
 
Back
Top