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. small file/prog association question

small file/prog association question

Scheduled Pinned Locked Moved C#
questionwindows-admin
7 Posts 3 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
    likefood
    wrote on last edited by
    #1

    I've seen this asked & answered before, but don't remember where (and can't seem to find it now that I'm interested). I want to be able to double-click on my own .xyz files and open them in my program, much like double-clicking on a .doc file opens it in your preferred word processor. I suspect it has to do with the registry and a commandline switch or arg or something. Can someone please point me in the right direction?

    -Daniel Typing too fast fro my owngood

    J 1 Reply Last reply
    0
    • L likefood

      I've seen this asked & answered before, but don't remember where (and can't seem to find it now that I'm interested). I want to be able to double-click on my own .xyz files and open them in my program, much like double-clicking on a .doc file opens it in your preferred word processor. I suspect it has to do with the registry and a commandline switch or arg or something. Can someone please point me in the right direction?

      -Daniel Typing too fast fro my owngood

      J Offline
      J Offline
      Jun Du
      wrote on last edited by
      #2

      If you're not asking for a programmatical approach, the simplest way would be following these three steps: 1) Right click on the file and go to "Open with..." menu. 2) Choose your program (executable) via "Browse..." button; then check "Always use the selected program to open this kind of file". 3) Click "OK" to close the "Open With" dialog.

      Best, Jun

      L 1 Reply Last reply
      0
      • J Jun Du

        If you're not asking for a programmatical approach, the simplest way would be following these three steps: 1) Right click on the file and go to "Open with..." menu. 2) Choose your program (executable) via "Browse..." button; then check "Always use the selected program to open this kind of file". 3) Click "OK" to close the "Open With" dialog.

        Best, Jun

        L Offline
        L Offline
        likefood
        wrote on last edited by
        #3

        My application isn't that cool yet. In the list, it doesn't have a name or description (just an icon). When I follow those steps, it opens my application without opening the selected file.

        -Daniel Typing too fast fro my owngood

        J 1 Reply Last reply
        0
        • L likefood

          My application isn't that cool yet. In the list, it doesn't have a name or description (just an icon). When I follow those steps, it opens my application without opening the selected file.

          -Daniel Typing too fast fro my owngood

          J Offline
          J Offline
          Jun Du
          wrote on last edited by
          #4

          I see. Then, you probably want to make your application to support certain document types first. A critical step I remember is that when you register the document templete in YourApp.cpp file, indicate the document type. Google "document templete" for more information.

          Best, Jun

          L 1 Reply Last reply
          0
          • J Jun Du

            I see. Then, you probably want to make your application to support certain document types first. A critical step I remember is that when you register the document templete in YourApp.cpp file, indicate the document type. Google "document templete" for more information.

            Best, Jun

            L Offline
            L Offline
            likefood
            wrote on last edited by
            #5

            That would be fine if I was still using C++, but I liberated myself from that a long time ago. It's just a plain C# Windows Forms application with some simple text file IO capabilities. I found a little help in an old MSKB article, but it's all VB, so it'll take me a bit to figure out what the heck they're trying to do (ie, I might as well be trying to read Portuguese, when I know Spanish instead). But it shouldn't be impossible, just tedius. Thank you anyway!

            -Daniel Typing too fast fro my owngood

            I 1 Reply Last reply
            0
            • L likefood

              That would be fine if I was still using C++, but I liberated myself from that a long time ago. It's just a plain C# Windows Forms application with some simple text file IO capabilities. I found a little help in an old MSKB article, but it's all VB, so it'll take me a bit to figure out what the heck they're trying to do (ie, I might as well be trying to read Portuguese, when I know Spanish instead). But it shouldn't be impossible, just tedius. Thank you anyway!

              -Daniel Typing too fast fro my owngood

              I Offline
              I Offline
              Irfan Kothari
              wrote on last edited by
              #6

              Hello friends, I was having same problem. I want my .xyz file associate with my application when i install the project. also i want to use the file name which has clicked in further in my code when my application will start. anybody have idea regarding this? i am realy stuck into this Please help me any kind of help is appreciable thanks in advance. Regards, Irfan Kothari.

              L 1 Reply Last reply
              0
              • I Irfan Kothari

                Hello friends, I was having same problem. I want my .xyz file associate with my application when i install the project. also i want to use the file name which has clicked in further in my code when my application will start. anybody have idea regarding this? i am realy stuck into this Please help me any kind of help is appreciable thanks in advance. Regards, Irfan Kothari.

                L Offline
                L Offline
                likefood
                wrote on last edited by
                #7

                As far as I can tell, there are two requirements: - put in a specific registry entry - adjust your program to account for a commandline argument However, I'm a little fuzzy on the details (and, since this thread has fallen so far down the list, I doubt anyone will reply), so you'll probably just have to keep searching the internet for the specifics.

                -Daniel Typing too fast fro my owngood

                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