Opening an image in my app by doubleclicking it in explorer

Opening an image in my app by doubleclicking it in explorer

Post by dave » Thu, 03 Jul 2003 04:56:33


I wrote an image viewing app, and i want to be able to associate graphic
files with my app, so that when i double click an image in explorer it opens
in my app. I have set the file association, but when i double-click say a
bmp in explorer, my app launches but the image does not display. How do i
accomplish this?

Any help would be greatly appreciated,
Dave

 
 
 

Opening an image in my app by doubleclicking it in explorer

Post by Michael Koo » Thu, 03 Jul 2003 05:04:44


Hi Dave,
I've never tested the following hint,
but I think that this must be the way.
You have to look for parameters...
I think that the Explorer places a parameter on your program launch.
Some, maybe, useful links:
http://delphi.about.com/library/weekly/aa062299.htm
http://www.delphibasics.co.uk/RTL.asp?Name=ParamStr
maybe the best link:
http://www.experts-exchange.com/Programming/Programming_Languages/Del...

best regards
Michael

dave schrieb:

Quote:> I wrote an image viewing app, and i want to be able to associate graphic
> files with my app, so that when i double click an image in explorer it opens
> in my app. I have set the file association, but when i double-click say a
> bmp in explorer, my app launches but the image does not display. How do i
> accomplish this?

> Any help would be greatly appreciated,
> Dave


 
 
 

Opening an image in my app by doubleclicking it in explorer

Post by Gordon Whitta » Thu, 03 Jul 2003 08:40:03



> I wrote an image viewing app, and i want to be able to associate graphic
> files with my app, so that when i double click an image in explorer it opens
> in my app. I have set the file association, but when i double-click say a
> bmp in explorer, my app launches but the image does not display. How do i
> accomplish this?

You have the association but you need to handle the file that's passed which
all things being equal will be ParamStr(1).

So somewhere in your app' during startup you'd have something like

fName: string;

  if ParamCount > 0 then
    fName:= ParamStr(1);
  if ExtractFileExt(fName) = SomethingYouCanHandle then
      LoadImage(fName);

Sort of

Gordon

 
 
 

Opening an image in my app by doubleclicking it in explorer

Post by dave » Thu, 03 Jul 2003 22:32:54


Thank you very much. That helped me immensely.
Now i just have to learn to set file associations in code.

Thanks again,
Dave


Quote:> Hi Dave,
> I've never tested the following hint,
> but I think that this must be the way.
> You have to look for parameters...
> I think that the Explorer places a parameter on your program launch.
> Some, maybe, useful links:
> http://delphi.about.com/library/weekly/aa062299.htm
> http://www.delphibasics.co.uk/RTL.asp?Name=ParamStr
> maybe the best link:

http://www.experts-exchange.com/Programming/Programming_Languages/Del...
0352493.html
Quote:

> best regards
> Michael

> dave schrieb:

> > I wrote an image viewing app, and i want to be able to associate graphic
> > files with my app, so that when i double click an image in explorer it
opens
> > in my app. I have set the file association, but when i double-click say
a
> > bmp in explorer, my app launches but the image does not display. How do
i
> > accomplish this?

> > Any help would be greatly appreciated,
> > Dave

 
 
 

Opening an image in my app by doubleclicking it in explorer

Post by Michael Koo » Fri, 04 Jul 2003 05:34:18


...and some useful links about file associations:
http://homepages.borland.com/efg2lab/Library/UseNet/1999/0314b.txt
http://homepages.borland.com/efg2lab/Library/Delphi/IO/Files.htm
maybe the best: http://www.latiumsoftware.com/en/pascal/0045.php
best regards
Michael

dave schrieb:

> Thank you very much. That helped me immensely.
> Now i just have to learn to set file associations in code.

> Thanks again,
> Dave



> > Hi Dave,
> > I've never tested the following hint,
> > but I think that this must be the way.
> > You have to look for parameters...
> > I think that the Explorer places a parameter on your program launch.
> > Some, maybe, useful links:
> > http://delphi.about.com/library/weekly/aa062299.htm
> > http://www.delphibasics.co.uk/RTL.asp?Name=ParamStr
> > maybe the best link:

> http://www.experts-exchange.com/Programming/Programming_Languages/Del...
> 0352493.html

> > best regards
> > Michael

> > dave schrieb:

> > > I wrote an image viewing app, and i want to be able to associate graphic
> > > files with my app, so that when i double click an image in explorer it
> opens
> > > in my app. I have set the file association, but when i double-click say
> a
> > > bmp in explorer, my app launches but the image does not display. How do
> i
> > > accomplish this?

> > > Any help would be greatly appreciated,
> > > Dave

 
 
 

1. Doubleclicking w/no image open

This is probably well-known, but I just stumbled on it for myself.  If
you open PS4, don't open any images and either doubleclick,
Control-doubleclick or Alt-doubleclick (pc keystrokes), you get the
Open, New and Open As dialog boxes respectively.  Neat!

--
- Peter

2. Win Computer Software

3. open files doubleclicking

4. Very basic question.

5. open with doubleclick

6. Hidden Line Removal

7. OPEN/image TIPS: Attention Wang OPEN/image document imaging sites

8. Electric symbols

9. Status of Data Explorer (now Open Source)

10. Open JPG file from Windows Explorer not working

11. jpeg's not opening up in Internet Explorer