CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    6

    Problem: Set your own icons as icon image on file icon

    Hi!

    Do u know how to use your own (self made) icon as a file icon when u save with:

    Employee e1 = new Employee("A", 45000.0);
    FileOutputStream fos = new FileOutputStream("employee.ser");
    ObjectOutputStream oos = new ObjectOutputStream(fos);
    oos.writeObject(e1);

    ?

    Well I'm developing a program where u can draw stuff on a drawingboard, so when I want to save that project (drawingboard with drawn stuff on it) I want to use my own icon but I don't know how to do it, and I have googled a lot.

    When I save the project the icon of the saved project is the Unknown Icon...

    Do u have any ideas?

    Or can I add my icon to shell32 and the retrieve my icon from there or something similar?

  2. #2
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Problem: Set your own icons as icon image on file icon

    Which icon is displayed for a file is up to the OS you are using, not the program that creates the file. AIUI the OS associates the file extension with an icon. To set your own icon, you'll have to get the OS to associate your icon with your file extension.

    Java can't really help with this, it is designed to be platform agnostic, so it has few OS specific facilities. I'd be inclined to use a native language (e.g. C/C++ or C# with Windows) or a OS-supported scripting language.

    The tools we use have a profound (and devious!) influence on our thinking habits, and, therefore, on our thinking abilities...
    E. Dijkstra
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured