Link to home
Start Free TrialLog in
Avatar of NaveenKhanna
NaveenKhanna

asked on

File type association using c or c++

Associate the file type to my own exe
ex

if my extension is ".ex"
if i double click the file with extension ".ex"
i should open with "myapp.exe"
ASKER CERTIFIED SOLUTION
Avatar of SreejithG
SreejithG
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NaveenKhanna
NaveenKhanna

ASKER

thanks for the reply
pls provide me c example
You could add new file extensions and their associated application by using the explorer. Right-click at a file with that extension, choose the 'Open with ...' menu item, and make the settings that for the given file type always your application should be used. At the command line (dos box) you can do the same using the ASSOC command (type assoc /?).

To open the file using your app after association use

ShellExecute(NULL, "open", full_path_of_file, NULL, "", SW_SHOW);
thank you