Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » File Icons
File Icons [message #439572] Tue, 13 July 2004 18:54 Go to next message
No real name is currently offline No real nameFriend
Messages: 13
Registered: July 2009
Junior Member
Hi,
I was wondering if anyone has an idea of how to (if it's possible)
retrieve icons from files in windows (not from the associated programs).
Thanks in advance,
Tej
Re: File Icons [message #439577 is a reply to message #439572] Tue, 13 July 2004 21:13 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Not sure what you are asking. There is the API in
org.eclipse.swt.program.Program:

/**
* Returns the receiver's image data. This is the icon
* that is associated with the reciever in the operating
* system.
*
* @return the image data for the program, may be null
*/
public ImageData getImageData ()

This, for example, will give you an image of the internet explorer icon when
you call Program.findProgram(".html") if you registered IE to be the
application that opens all html files.

"Tej" <swt.10.tej@spamgourmet.com> wrote in message
news:cd1b56$n95$1@eclipse.org...
> Hi,
> I was wondering if anyone has an idea of how to (if it's possible)
> retrieve icons from files in windows (not from the associated programs).
> Thanks in advance,
> Tej
>
Re: File Icons [message #439578 is a reply to message #439577] Tue, 13 July 2004 21:35 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 13
Registered: July 2009
Junior Member
Thanks. What I'm looking for though is how to get an icon of a file
without a program associated. For example, if I wanted an icon for the
file "C:\Program Files\Internet Explorer\IEXPLORE.EXE" which I believe
stores the icon in itself. I don't see anything in Program that will help
with this.
-Tej

Veronika Irvine wrote:

> Not sure what you are asking. There is the API in
> org.eclipse.swt.program.Program:

> /**
> * Returns the receiver's image data. This is the icon
> * that is associated with the reciever in the operating
> * system.
> *
> * @return the image data for the program, may be null
> */
> public ImageData getImageData ()

> This, for example, will give you an image of the internet explorer icon when
> you call Program.findProgram(".html") if you registered IE to be the
> application that opens all html files.

> "Tej" <swt.10.tej@spamgourmet.com> wrote in message
> news:cd1b56$n95$1@eclipse.org...
> > Hi,
> > I was wondering if anyone has an idea of how to (if it's possible)
> > retrieve icons from files in windows (not from the associated programs).
> > Thanks in advance,
> > Tej
> >
Re: File Icons [message #439594 is a reply to message #439578] Wed, 14 July 2004 13:14 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
I suppose you could get all available programs with Program.getPrograms()
and for each program in the resulting array, use getName() to determine if
it is "Internet Explorer" for example.

"Tej" <swt.10.tej@spamgourmet.com> wrote in message
news:cd1kjp$79n$1@eclipse.org...
> Thanks. What I'm looking for though is how to get an icon of a file
> without a program associated. For example, if I wanted an icon for the
> file "C:\Program Files\Internet Explorer\IEXPLORE.EXE" which I believe
> stores the icon in itself. I don't see anything in Program that will help
> with this.
> -Tej
>
> Veronika Irvine wrote:
>
> > Not sure what you are asking. There is the API in
> > org.eclipse.swt.program.Program:
>
> > /**
> > * Returns the receiver's image data. This is the icon
> > * that is associated with the reciever in the operating
> > * system.
> > *
> > * @return the image data for the program, may be null
> > */
> > public ImageData getImageData ()
>
> > This, for example, will give you an image of the internet explorer icon
when
> > you call Program.findProgram(".html") if you registered IE to be the
> > application that opens all html files.
>
> > "Tej" <swt.10.tej@spamgourmet.com> wrote in message
> > news:cd1b56$n95$1@eclipse.org...
> > > Hi,
> > > I was wondering if anyone has an idea of how to (if it's possible)
> > > retrieve icons from files in windows (not from the associated
programs).
> > > Thanks in advance,
> > > Tej
> > >
>
>
Re: File Icons [message #439601 is a reply to message #439578] Wed, 14 July 2004 15:15 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=4643

Note that some platforms (Linux) do not store icons as named resources
within the executable so the API could never work there because the concept
doesn't exist.

"Tej" <swt.10.tej@spamgourmet.com> wrote in message
news:cd1kjp$79n$1@eclipse.org...
> Thanks. What I'm looking for though is how to get an icon of a file
> without a program associated. For example, if I wanted an icon for the
> file "C:\Program Files\Internet Explorer\IEXPLORE.EXE" which I believe
> stores the icon in itself. I don't see anything in Program that will help
> with this.
> -Tej
>
> Veronika Irvine wrote:
>
> > Not sure what you are asking. There is the API in
> > org.eclipse.swt.program.Program:
>
> > /**
> > * Returns the receiver's image data. This is the icon
> > * that is associated with the reciever in the operating
> > * system.
> > *
> > * @return the image data for the program, may be null
> > */
> > public ImageData getImageData ()
>
> > This, for example, will give you an image of the internet explorer icon
when
> > you call Program.findProgram(".html") if you registered IE to be the
> > application that opens all html files.
>
> > "Tej" <swt.10.tej@spamgourmet.com> wrote in message
> > news:cd1b56$n95$1@eclipse.org...
> > > Hi,
> > > I was wondering if anyone has an idea of how to (if it's possible)
> > > retrieve icons from files in windows (not from the associated
programs).
> > > Thanks in advance,
> > > Tej
> > >
>
>
Previous Topic:What SWT component replaces the JInternalFrame
Next Topic:accessing the mozilla dom through java
Goto Forum:
  


Current Time: Fri Mar 29 10:10:15 GMT 2024

Powered by FUDForum. Page generated in 0.03175 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top