Assigning icon without registering window.

This is a discussion on Assigning icon without registering window. within the Windows Programming forums, part of the Platform Specific Boards category; Is it possible? I'm using the API and my program is dialog box only. I don't need to create a ...

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    26

    Assigning icon without registering window.

    Is it possible? I'm using the API and my program is dialog box only. I don't need to create a registered window. How do I assign it an icon that will be shown in Windows Explorer.

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Use SendMessage to send a WM_SETICON to change the large or small icon of any window.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    26
    ^not the answer I was looking for. I'm talking about the icon of the program in a desktop or explorer. The program is not running.

    without using this:

    wc.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_MAINICO));

  4. #4
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Explorer simply uses the first icon resource of your program. Explorer does not start your program to find an icon, so what it does at runtime is irrelevant. So add an icon resource.

  5. #5
    Registered User
    Join Date
    Aug 2003
    Posts
    26
    ^Thanks man, that did the trick.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 10:06 AM
  3. My Window Class
    By Epo in forum Game Programming
    Replies: 2
    Last Post: 07-10-2005, 02:33 PM
  4. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  5. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21