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