System icons on windows

Discussion in 'Java' started by Nuno, Sep 7, 2007.

  1. Nuno

    Nuno Guest

    Hello,

    There is any way of retrieving from the system the icons associated to
    the windows explorer files? Example .rar extension has a nice book
    icon, how to retrieve this icon and use it on my application or any
    other file?

    Nuno
    Nuno, Sep 7, 2007
    #1
    1. Advertising

  2. Nuno

    kcwong Guest

    On Sep 7, 5:02 pm, Nuno <> wrote:
    > Hello,
    >
    > There is any way of retrieving from the system the icons associated to
    > the windows explorer files? Example .rar extension has a nice book
    > icon, how to retrieve this icon and use it on my application or any
    > other file?
    >
    > Nuno


    Google for icon extractors, or resource extractors... there're many
    free ones.

    If you have Visual Studio, you can open DLL or EXE file as Resource.
    Then you can save the icons to image files.
    kcwong, Sep 7, 2007
    #2
    1. Advertising

  3. On Sep 7, 11:02 am, Nuno <> wrote:
    > There is any way of retrieving from the system the icons associated to
    > the windows explorer files?


    Yes, but icons are typically copyrighted material.

    > how to retrieve this icon and use it on my application


    It is not a very bright idea to announce an intended copyright
    violation pin public.
    Hunter Gratzner, Sep 7, 2007
    #3
  4. Nuno

    Real Gagnon Guest

    Real Gagnon, Sep 7, 2007
    #4
  5. Nuno

    Nuno Guest

    On 7 Set, 12:23, Real Gagnon <> wrote:
    > > There is any way of retrieving from the system the icons associated to
    > > the windows explorer files? Example .rar extension has a nice book
    > > icon, how to retrieve this icon and use it on my application or any
    > > other file?

    >
    > "Display icon associated with an executable"http://www.rgagnon.com/javadetails/java-0439.html
    >
    > Bye.
    > --
    > Real Gagnon from Quebec, Canada
    > * Java, Javascript, VBScript and PowerBuilder code snippets
    > *http://www.rgagnon.com/howto.html
    > *http://www.rgagnon.com/bigindex.html


    Ok this will work just fine

    Program program = Program.findProgram(extension);
    ImageData imageData = (program == null ? null :
    program.getImageData());
    if (imageData != null) {
    image = new Image(Display.getCurrent(), imageData);

    But now i need to get the default images for the folders, open and
    close folders, and for the default file. any one knows how to do it?

    Nuno


    Nuno
    Nuno, Sep 7, 2007
    #5
  6. Nuno

    Christian Guest

    Nuno schrieb:
    > On 7 Set, 12:23, Real Gagnon <> wrote:
    >>> There is any way of retrieving from the system the icons associated to
    >>> the windows explorer files? Example .rar extension has a nice book
    >>> icon, how to retrieve this icon and use it on my application or any
    >>> other file?

    >> "Display icon associated with an executable"http://www.rgagnon.com/javadetails/java-0439.html
    >>
    >> Bye.
    >> --
    >> Real Gagnon from Quebec, Canada
    >> * Java, Javascript, VBScript and PowerBuilder code snippets
    >> *http://www.rgagnon.com/howto.html
    >> *http://www.rgagnon.com/bigindex.html

    >
    > Ok this will work just fine
    >
    > Program program = Program.findProgram(extension);
    > ImageData imageData = (program == null ? null :
    > program.getImageData());
    > if (imageData != null) {
    > image = new Image(Display.getCurrent(), imageData);
    >
    > But now i need to get the default images for the folders, open and
    > close folders, and for the default file. any one knows how to do it?
    >
    > Nuno
    >
    >
    > Nuno
    >

    Though SWT program class doesn't work too well either.
    I don't get allways the correct image for some file.
    For default file and folders I am using usually icons that are under
    LGPL ... these should fit with most licenses ..
    Christian, Sep 7, 2007
    #6
  7. Nuno

    Guest

    On Sep 7, 5:53 am, Hunter Gratzner <> wrote:
    > It is not a very bright idea to announce an intended copyright
    > violation pin public.


    On Usenet, being a netkkkop is frowned upon more.
    , Sep 8, 2007
    #7
  8. On Sep 8, 3:47 am, wrote:
    > On Usenet, being a netkkkop is frowned upon more.


    Paul, go away.
    Hunter Gratzner, Sep 8, 2007
    #8
  9. Nuno

    Guest

    On Sep 8, 4:48 am, Hunter Gratzner <> wrote:
    > On Sep 8, 3:47 am, wrote:
    >
    > > On Usenet, being a netkkkop is frowned upon more.

    >
    > Paul, go away.


    This response is rather odd, since it seems to have nothing to do with
    the post it follows up to. Who is Paul? That name isn't anywhere else
    in this thread, so I can't begin to guess who you're referring to...
    , Sep 9, 2007
    #9
  10. wrote:
    > On Sep 8, 4:48 am, Hunter Gratzner <> wrote:
    >> On Sep 8, 3:47 am, wrote:
    >>> On Usenet, being a netkkkop is frowned upon more.

    >> Paul, go away.

    >
    > This response is rather odd, since it seems to have nothing to do with
    > the post it follows up to. Who is Paul? That name isn't anywhere else
    > in this thread, so I can't begin to guess who you're referring to...


    You don't have to guess - you just need to remember some
    relative recent threads where you were presented for various
    peoples reasons to believe that you are Paul Derbyshire.

    You deny that it is true, but it seems rather silly to
    deny knowing why people think so.

    Arne
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Sep 9, 2007
    #10
  11. Nuno

    Roedy Green Guest

    On Fri, 07 Sep 2007 02:02:47 -0700, Nuno <>
    wrote, quoted or indirectly quoted someone who said :

    >There is any way of retrieving from the system the icons associated to
    >the windows explorer files? Example .rar extension has a nice book
    >icon, how to retrieve this icon and use it on my application or any
    >other file?


    There are three parts to the problem.

    1. looking up in the registry the extension to find the corresponding
    exe. For this you need JNI. See
    http://mindprod.com/jgloss/jni.html
    http://mindprod.com/jgloss/registry.html
    http://mindprod.com/project/associations.html


    2. Once you find the exe, you need to navigate the exe header to find
    the embedded *.ico file. see http://mindprod.com/jgloss/icon.html

    3. Extract the desired image size out of the ico and convert it to a
    PNG. Perhaps can do this with JAI. I have not looked. see
    http://mindprod.com/jgloss/jai.html

    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Sep 10, 2007
    #11
  12. Nuno

    Guest

    On Sep 9, 2:00 pm, Arne Vajhøj <> wrote:
    [snip unwanted, off-topic, potentially-illegal, and just plain wrong
    speculation about my identity]

    Shut up.
    , Sep 11, 2007
    #12
  13. Nuno

    kaldrenon Guest

    On Sep 10, 10:53 pm, wrote:
    > On Sep 9, 2:00 pm, Arne Vajhøj <> wrote:
    > [snip unwanted, off-topic, potentially-illegal, and just plain wrong
    > speculation about my identity]
    >
    > Shut up.


    Arne didn't actually speculate about your identity. He just pointed
    out that it's a little odd for you to pretend that you're unaware of
    the several speculations and attempts to uncover your identity that
    have been made recently.

    Frankly, I don't care if you're Paul Derbyshire. If you are, then that
    means I only have one person to pity. If you're not, there are two,
    since the information (true or false) presented about Paul made him
    sound a lot like you. But whether you are or not, please don't pretend
    that people haven't suggested it before.
    kaldrenon, Sep 11, 2007
    #13
  14. Nuno

    Guest

    [snip a whole load of BS]

    Perhaps the message wasn't clear. What I meant to say was this:

    END OF DISCUSSION

    My offline identity is not a topic for discussion in
    comp.lang.java.programmer and that is final. End of story. End of
    thread. Finito.

    Now go away.
    , Sep 11, 2007
    #14
  15. Nuno

    Roedy Green Guest

    On Tue, 11 Sep 2007 08:10:59 -0000, wrote, quoted
    or indirectly quoted someone who said :

    >My offline identity is not a topic for discussion in
    >comp.lang.java.programmer and that is final. End of story. End of
    >thread. Finito.


    If you are playing games with your identity, it suggests you may be a
    malicious character and your advice may be harmful.
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Sep 11, 2007
    #15
  16. Nuno

    Guest

    On Sep 11, 12:28 pm, Roedy Green <>
    wrote:
    > On Tue, 11 Sep 2007 08:10:59 -0000, wrote, quoted
    > or indirectly quoted someone who said :
    >
    > >My offline identity is not a topic for discussion in
    > >comp.lang.java.programmer and that is final. End of story. End of
    > >thread. Finito.

    >
    > If you are playing games with your identity, it suggests you may be a
    > malicious character and your advice may be harmful.


    I am not "playing games" with my identity. The reason I have two
    (Twisted and Nebulous) has been explained here before; and the reason
    I am now only using Nebulous is because someone (and I suspect I know
    exactly who, and that they are a regular here in cljp) destroyed the
    Twisted one somehow -- I can log in to it at GG, but if I navigate to
    a group and try to post I find it's logged out again all by itself
    after a short time. This started about a week ago.
    , Sep 13, 2007
    #16
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nick
    Replies:
    1
    Views:
    668
  2. Zubair.NET!
    Replies:
    1
    Views:
    345
  3. Arun

    Cool system icons

    Arun, Dec 27, 2004, in forum: Java
    Replies:
    4
    Views:
    689
  4. Richie Williams
    Replies:
    5
    Views:
    1,493
    Richie Williams
    Oct 25, 2007
  5. Tom Medhurst

    RubyCocoa and Mac System Icons

    Tom Medhurst, Feb 4, 2009, in forum: Ruby
    Replies:
    5
    Views:
    169
    Adam Gardner
    Mar 14, 2009
Loading...

Share This Page