Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7884405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:47:28+00:00 2026-06-03T04:47:28+00:00

I just finished this tutorial – Create a Picture Viewer – on the MSDN

  • 0

I just finished this tutorial – Create a Picture Viewer – on the MSDN site, and it all works well according to the tutorial specifications (although I did remove the unnecessary buttons).

At the moment, I can open an image file from within the program, which is fine.
However, I’d like to be able to open an image file from Windows Explorer, and have it open in my Image Viewer. (Using the Open With.. context menu).

I did try and open it via the Open With.. menu, but when the program loaded, the image didn’t show up. The program just started up as it normally would.

What code do I need to put in, that allows me to open the program via an image file (if that makes sense)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T04:47:30+00:00Added an answer on June 3, 2026 at 4:47 am

    You can use:

    Environment.CommandLine
    

    Which will contain stuff in the format of “…” “…”, first being the path of your application, and in your case – second would be the path of the opened-with file.

    Then, you can split that to get the second “…” and load the file as you normally do in you application.

    You can also check to see whether the arguments of the application contain the path of the opened-with file. I’m not sure about that, but it should be very easy to check: Have an mbox which prints the parameters, then try opening a file with your program and see what shows up. Using the args[0] or args[1] or whatever will probably be easier than splitting Environment.CommandLine…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning WPF and started with this MSDN tutorial. I was just following the
I just finished my first own example with activities/places and MVP. all works fine
Just finished reading this blog post: http://www.skorks.com/2010/03/an-interview-question-that-prints-out-its-own-source-code-in-ruby/ In it, the author argues the case
I just finished looking at this question: https://stackoverflow.com/questions/753122/which-cloud-computing-platform-should-i-choose But, I am not certain what
I just finished the Django tutorial and started work on my own project, however,
I just finished the Netbeans introduction to Hibernate tutorial ( http://netbeans.org/kb/docs/web/hibernate-webapp.html#01 ) and I
I've just finished going through the MvcMusicStore tutorial found here . It's an excellent
I'm just finished my first month of getting to grips with flex. All of
I just finished create my own wordpress theme. But when I checked the html
I just finished the NotepadV1-3 tutorial for Android apps, and I was thinking of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.