Thread: Icons in dialogs...

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    18

    Icons in dialogs...

    If I have a resource editor created dialog in VC++, is it possible to compile it and choose which icon will be shown for the exe?

    I know this can be done by creating the window by making the window class.. registering and showing.. but I'm too damn lazy to type in all the coords for the CreateWindowEx()'s and stuff.. heh.
    Thanks for any help.
    ~void

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>If I have a resource editor created dialog in VC++, is it possible to compile it and choose which icon will be shown for the exe?<<

    Not 'automatically' for dialog resources. Use this instead (can be used with normal windows too):

    Code:
    SendMessage(hwnd, WM_SETICON, nIconType, (LPARAM) hIcon);
    where hwnd is the handle of your dialog/window, nIconType is one of two values (ICON_BIG or ICON_SMALL) and hIcon is the handle of the icon retrieved, preferably as the return value of a succesful call to 'LoadImage', but LoadIcon will do. For clarification read up on WM_SETICON in msdn.

    edit: formatting
    Last edited by Ken Fitlike; 10-26-2002 at 04:29 PM.

  3. #3
    Registered User
    Join Date
    Oct 2002
    Posts
    18
    Worked like a charm, thanks!
    ~void

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. [C] Problem with icons in a toolbar
    By pc2-brazil in forum Windows Programming
    Replies: 3
    Last Post: 12-22-2008, 11:04 PM
  2. Getting Icons from the Desktop
    By Mastadex in forum Windows Programming
    Replies: 6
    Last Post: 08-29-2007, 04:33 PM
  3. Ok..Tabbed dialogs...XP style
    By Joelito in forum Windows Programming
    Replies: 5
    Last Post: 05-14-2006, 02:36 PM
  4. I need to use dialogs as tabs?
    By BenPage in forum C++ Programming
    Replies: 1
    Last Post: 08-03-2005, 08:59 AM
  5. Modeless Dialogs in Multiple threads
    By MrGrieves in forum Windows Programming
    Replies: 0
    Last Post: 06-22-2004, 01:33 PM