Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to run your application by double-clicking a file?

How to run your application by double-clicking a file?

Scheduled Pinned Locked Moved C#
questionsysadminhelptutorialworkspace
11 Posts 5 Posters 0 Views 1 Watching
  • 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.
  • L Offline
    L Offline
    Lyfkcd
    wrote on last edited by
    #1

    Please help.., how do i load a file in the application i made upon double-clicking on the file itself? I need this without going through setup and deployment actions...Please anyone? ............

    N J E 3 Replies Last reply
    0
    • L Lyfkcd

      Please help.., how do i load a file in the application i made upon double-clicking on the file itself? I need this without going through setup and deployment actions...Please anyone? ............

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Lyfkcd wrote:

      how do i load a file in the application i made upon double-clicking on the file itself

      Try looking here http://www.codeproject.com/csharp/dateparser.asp[^]

      Lyfkcd wrote:

      I need this without going through setup and deployment actions

      I have no idea what you mean by this.


      only two letters away from being an asset

      L 1 Reply Last reply
      0
      • L Lyfkcd

        Please help.., how do i load a file in the application i made upon double-clicking on the file itself? I need this without going through setup and deployment actions...Please anyone? ............

        J Offline
        J Offline
        jonny5
        wrote on last edited by
        #3

        Right-click the file, Open With -> Choose Program...

        Jon Humphreys ActivePlanet Software

        N 1 Reply Last reply
        0
        • J jonny5

          Right-click the file, Open With -> Choose Program...

          Jon Humphreys ActivePlanet Software

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          OP: "upon double-clicking on the file itself" I don't think "Right-click the file, Open With -> Choose Program..." qualifies.


          only two letters away from being an asset

          J 1 Reply Last reply
          0
          • L Lyfkcd

            Please help.., how do i load a file in the application i made upon double-clicking on the file itself? I need this without going through setup and deployment actions...Please anyone? ............

            E Offline
            E Offline
            Ed Poore
            wrote on last edited by
            #5
            • Open up regedit
            • Goto HKEY_CLASSES_ROOT
            • Create (or modify) the default value of the key which is .ext where ext is the extension to point to another keyname e.g. extfile
            • Create a key under HKEY_CLASSES_ROOT called extfile
            • Create a subkey called Shell
            • Create a subkey called Open
            • Change the default value to point to your program with %1 being passed as an argument, %1 will be replaced by the shell with the name of the file you clicked

            Hope I got that right from the top of my head :rolleyes:


            I have no idea what I just said. But my intentions were sincere.

            L L 2 Replies Last reply
            0
            • N Not Active

              OP: "upon double-clicking on the file itself" I don't think "Right-click the file, Open With -> Choose Program..." qualifies.


              only two letters away from being an asset

              J Offline
              J Offline
              jonny5
              wrote on last edited by
              #6

              Its the pre-qualifier to "upon double-clicking on the file itself" and satisfies the "without going through setup and deployment actions" requirement. 1) Right-click the file, Open With -> Choose Program... 2) Browse for your program. 3) Check the "Always use the selected program..." and click OK The Shell Open registry entries are then done for you without using RegEdit.

              Jon Humphreys ActivePlanet Software

              L 1 Reply Last reply
              0
              • E Ed Poore
                • Open up regedit
                • Goto HKEY_CLASSES_ROOT
                • Create (or modify) the default value of the key which is .ext where ext is the extension to point to another keyname e.g. extfile
                • Create a key under HKEY_CLASSES_ROOT called extfile
                • Create a subkey called Shell
                • Create a subkey called Open
                • Change the default value to point to your program with %1 being passed as an argument, %1 will be replaced by the shell with the name of the file you clicked

                Hope I got that right from the top of my head :rolleyes:


                I have no idea what I just said. But my intentions were sincere.

                L Offline
                L Offline
                Luc Pattyn
                wrote on last edited by
                #7

                Sure. Now have the EXE itself check, and if first time, modify the registry to programmatically execute those steps. It is not difficult at all. Now the user simply has to double click the EXE once, after that he can double click either the EXE or one of the application's data files. :)

                Luc Pattyn

                1 Reply Last reply
                0
                • E Ed Poore
                  • Open up regedit
                  • Goto HKEY_CLASSES_ROOT
                  • Create (or modify) the default value of the key which is .ext where ext is the extension to point to another keyname e.g. extfile
                  • Create a key under HKEY_CLASSES_ROOT called extfile
                  • Create a subkey called Shell
                  • Create a subkey called Open
                  • Change the default value to point to your program with %1 being passed as an argument, %1 will be replaced by the shell with the name of the file you clicked

                  Hope I got that right from the top of my head :rolleyes:


                  I have no idea what I just said. But my intentions were sincere.

                  L Offline
                  L Offline
                  Lyfkcd
                  wrote on last edited by
                  #8

                  thank you so much...it worked...

                  E 1 Reply Last reply
                  0
                  • L Lyfkcd

                    thank you so much...it worked...

                    E Offline
                    E Offline
                    Ed Poore
                    wrote on last edited by
                    #9

                    Not a problem, it's nice to be thanked once in a while, so thanks for the thanks.


                    I have no idea what I just said. But my intentions were sincere.

                    Poore Design

                    1 Reply Last reply
                    0
                    • J jonny5

                      Its the pre-qualifier to "upon double-clicking on the file itself" and satisfies the "without going through setup and deployment actions" requirement. 1) Right-click the file, Open With -> Choose Program... 2) Browse for your program. 3) Check the "Always use the selected program..." and click OK The Shell Open registry entries are then done for you without using RegEdit.

                      Jon Humphreys ActivePlanet Software

                      L Offline
                      L Offline
                      Lyfkcd
                      wrote on last edited by
                      #10

                      Im sorry if i didnt quite say it.., i was wondering if how my c# application would output a file..but can in turn activate my application through clicking the file itself. Registered maybe in windows registry...having default file types, icons, etc. Thanks anyway...

                      1 Reply Last reply
                      0
                      • N Not Active

                        Lyfkcd wrote:

                        how do i load a file in the application i made upon double-clicking on the file itself

                        Try looking here http://www.codeproject.com/csharp/dateparser.asp[^]

                        Lyfkcd wrote:

                        I need this without going through setup and deployment actions

                        I have no idea what you mean by this.


                        only two letters away from being an asset

                        L Offline
                        L Offline
                        Lyfkcd
                        wrote on last edited by
                        #11

                        Sorry for not describing my prblem well, im just new in programming. anyway, i meant modifying the registry.., didnt had the idea before, so i wasnt able to explain it very well. I meant, the file having default icons, file type, opens my own application through clicking the file itself...etc. Thanks 4 your help...

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups