Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Additional details of Files?

    General and Desktop
    2
    5
    1449
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • CAD_coding
      CAD_coding last edited by

      Hi,
      I have a file format for my application.
      I want to associate it to my application such that any file with that extension is double clicked it should open my application & pass the path of file to the exe as a command line argument.
      How do I do that?
      Is it possible to achieve this independent of OS?
      If yes then how will the OS know the path of exe that must be run for that extension?

      PS: Example when we double click a pdf file, it results in launching Adobe Reader & opening that pdf. How do I achieve similar functionality for my application?

      1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators last edited by

        this is very OS specific. For windows see this "KB article":http://support.microsoft.com/kb/307859.

        If you want to register it on setup time (windows) you will need to alter the windows registry: see "this":http://social.msdn.microsoft.com/Forums/vstudio/en-US/630ed1d9-73f1-4cc0-bc84-04f29cffc13b/what-registry-keys-are-responsible-for-file-extension-association.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply Reply Quote 0
        • CAD_coding
          CAD_coding last edited by

          The links you gave me are for manually creating the associativity.
          I want to create the associativity by code.

          Doesnt Qt have its way of doing this?

          And what about other OS?

          What do people normally do for achieving this associativity?

          1 Reply Last reply Reply Quote 0
          • raven-worx
            raven-worx Moderators last edited by

            [quote author="CAD_coding" date="1372166293"]
            The links you gave me are for manually creating the associativity.
            I want to create the associativity by code.
            [/quote]
            The first one is, but not the second one! You can alter the windows registry by code. e.g. this is possible with QSettings.

            [quote author="CAD_coding" date="1372166293"]
            Doesnt Qt have its way of doing this?
            [/quote]
            No... i doubt that.

            [quote author="CAD_coding" date="1372166293"]
            And what about other OS?
            [/quote]
            i don't know...don't know how the exact mechanismn is on linux or mac platforms. Maybe someone else can help you out here?
            But for sure there is a similar solution like for windows.

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply Reply Quote 0
            • CAD_coding
              CAD_coding last edited by

              Hi raven,

              Thanks for your help!
              Looks like I am on my own now...

              1 Reply Last reply Reply Quote 0
              • First post
                Last post