Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Opening an image by double clicking the image in windows explorer


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Sep 11, 2017 9:39 PM Last Post By: Travis Freitag Threads: [ Previous | Next ]
Travis Freitag

Posts: 2
Registered: 10/6/17
Opening an image by double clicking the image in windows explorer  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 5, 2017 8:21 PM
I am trying to build an image viewer. I have everything completed except when I make my program the default image viewer and double click an image my program opens but doesn't load the image I double clicked.

How do I tell my program the file path of the image I double clicked?
Antonio Estevez

Posts: 665
Registered: 4/12/00
Re: Opening an image by double clicking the image in windows explorer  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 6, 2017 12:47 AM   in response to: Travis Freitag in response to: Travis Freitag
El 06/09/2017 a las 05:21, Travis Freitag escribió:
I am trying to build an image viewer. I have everything completed except when I make my program the default image viewer and double click an image my program opens but doesn't load the image I double clicked.

How do I tell my program the file path of the image I double clicked?

Usually the file path is passed to the applicantion as the first
parameter of the command line:
    if (ParamCount> 0)
    {
       String FileName= ParamStr(1);
       // use FileName as needed;
    }
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Opening an image by double clicking the image in windows explorer  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 6, 2017 10:41 AM   in response to: Antonio Estevez in response to: Antonio Estevez
Antonio Estevez wrote:

Usually the file path is passed to the applicantion as the first
parameter of the command line:

Only if that is how you setup the file extension to behave in the
Registry.

--
Remy Lebeau (TeamB)
Travis Freitag

Posts: 2
Registered: 10/6/17
Re: Opening an image by double clicking the image in windows explorer  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 11, 2017 9:39 PM   in response to: Antonio Estevez in response to: Antonio Estevez
Antonio Estevez wrote:
El 06/09/2017 a las 05:21, Travis Freitag escribió:
I am trying to build an image viewer. I have everything completed except when I make my program the default image viewer and double click an image my program opens but doesn't load the image I double clicked.

How do I tell my program the file path of the image I double clicked?

Usually the file path is passed to the applicantion as the first
parameter of the command line:
    if (ParamCount> 0)
    {
       String FileName= ParamStr(1);
       // use FileName as needed;
    }

Works great, thank you! Was driving myself crazy looking for the answer. Just have to tell my program which image extensions to accept. Thanks again.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02