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. Visual Basic
  4. handle open documents

handle open documents

Scheduled Pinned Locked Moved Visual Basic
tutorialcsharphelp
3 Posts 2 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.
  • A Offline
    A Offline
    acecase
    wrote on last edited by
    #1

    I'm sorry for the subject but ashamed as I am, I can't think of how to summerize (or realy even how to say) what I am looking for. First let me say that I'm not asking anyone to write my code for me or show me step by step but I'm asking more for someone to tell me what I need to look for. I am trying to figure out how to make a program open files that I click on. I know that is a windows setting and I know how to make my program the default :) My problem is that if I make my text editor the default text editor (tell windows to open all .txt with it) then click on a .txt, it launches my program but it doesn't open the txt file. My problem is that I don't even know what to search for to find info on this problem. I'm sure its simple so please don't just discard this as someone who is totaly ignorant. I have taken a hands-on aproach to vb.net as my learnvisualstudio.net lessons teach and so when I got comfortable with the basics I just started writeing and search for things as I need them. Again, my problem now though is that I don't even know what to search for. Thank you 2 U.S. coins equal 30 cents and one is NOT a nickle. Hmm..

    D 1 Reply Last reply
    0
    • A acecase

      I'm sorry for the subject but ashamed as I am, I can't think of how to summerize (or realy even how to say) what I am looking for. First let me say that I'm not asking anyone to write my code for me or show me step by step but I'm asking more for someone to tell me what I need to look for. I am trying to figure out how to make a program open files that I click on. I know that is a windows setting and I know how to make my program the default :) My problem is that if I make my text editor the default text editor (tell windows to open all .txt with it) then click on a .txt, it launches my program but it doesn't open the txt file. My problem is that I don't even know what to search for to find info on this problem. I'm sure its simple so please don't just discard this as someone who is totaly ignorant. I have taken a hands-on aproach to vb.net as my learnvisualstudio.net lessons teach and so when I got comfortable with the basics I just started writeing and search for things as I need them. Again, my problem now though is that I don't even know what to search for. Thank you 2 U.S. coins equal 30 cents and one is NOT a nickle. Hmm..

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Does your app take command-line arguments? When you double-click an item in Windows Explorer, it launches something like this (unless the association is configured differently):

      RegisteredApp.exe C:\Path\DocumentYouClickedOn.txt

      If your app doesn't process the command-line arguments, you'll never know what file to open on launch. Your association can be configured to launch your app in different ways, using different command-line args or using DDE, or something else. By default, it'll launch using the above method. To find out more, just open a window in Explorer, like C:\, go to the Tools/Folder Options menu, then click on the File Types tab. Next, scroll down to TXT (Text Document) and you'll find the definition for TXT and Notepad. You'll find 3 actions if you click on Advanced: Open, Print, and PrintTo. Click on Open, then on Edit and you see that Notepad is launched like this:

      C:\WINDOWS\system32\NOTEPAD.EXE %1

      The %1 is replaced by the full path to the document that you double clicked on. RageInTheMachine9532

      A 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Does your app take command-line arguments? When you double-click an item in Windows Explorer, it launches something like this (unless the association is configured differently):

        RegisteredApp.exe C:\Path\DocumentYouClickedOn.txt

        If your app doesn't process the command-line arguments, you'll never know what file to open on launch. Your association can be configured to launch your app in different ways, using different command-line args or using DDE, or something else. By default, it'll launch using the above method. To find out more, just open a window in Explorer, like C:\, go to the Tools/Folder Options menu, then click on the File Types tab. Next, scroll down to TXT (Text Document) and you'll find the definition for TXT and Notepad. You'll find 3 actions if you click on Advanced: Open, Print, and PrintTo. Click on Open, then on Edit and you see that Notepad is launched like this:

        C:\WINDOWS\system32\NOTEPAD.EXE %1

        The %1 is replaced by the full path to the document that you double clicked on. RageInTheMachine9532

        A Offline
        A Offline
        acecase
        wrote on last edited by
        #3

        IC, Thank you. I knew how windows handled opening documents but I had no idea how to catch that in my aplication. So now I know where to start (read up on accepting command line options/paramiters) Thank you very much. This was what I needed to know++. 2 U.S. coins equal 30 cents and one is NOT a nickle. Hmm..

        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