File type association using c or c++

Posted on 2008-11-20
Last Modified: 2012-05-05
Associate the file type to my own exe

if my extension is ".ex"
if i double click the file with extension ".ex"
i should open with "myapp.exe"
Question by:NaveenKhanna
    LVL 3

    Accepted Solution

    You need to Associate File Extension with Shell OPEN command

    sample available in

    Author Comment

    thanks for the reply
    pls provide me c example
    LVL 39

    Expert Comment

    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);

    Author Closing Comment

    thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
    Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode ( They will have you believe that Unicode requires you to use…
    The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
    The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now