How can I do this?"open with"
-
I created a program which has a "Load Picture" button, and a Picture Box .Whenever I click a "Load Picture" button, it will show a Open File Dialog then selected file will load to a picture box. My question is How I can make the picture loads to my Picture Box when User right click on a image file ---> Open With --> browse for my program. Like Photoshop, you know, when you rigt click a image file ---> Open With ---> Photoshop --> then Photoshop will open with that image file. Thanks !
-
I created a program which has a "Load Picture" button, and a Picture Box .Whenever I click a "Load Picture" button, it will show a Open File Dialog then selected file will load to a picture box. My question is How I can make the picture loads to my Picture Box when User right click on a image file ---> Open With --> browse for my program. Like Photoshop, you know, when you rigt click a image file ---> Open With ---> Photoshop --> then Photoshop will open with that image file. Thanks !
When Windows tries to open a file with your application, it's simply calling your executable with the file path as an argument. It's basically the same as dropping a file on your executable in a windows explorer window. So you just have to handle the arguments you get at startup in your
Main
method. Regards, mav -- Black holes are the places where god divided by 0... -
When Windows tries to open a file with your application, it's simply calling your executable with the file path as an argument. It's basically the same as dropping a file on your executable in a windows explorer window. So you just have to handle the arguments you get at startup in your
Main
method. Regards, mav -- Black holes are the places where god divided by 0...