CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2004
    Posts
    109

    16x16 Status Tray Icon

    Hi all.

    I've made a little Dialog app that has a status tray icon. However, i always seem to end up with the 32x32 icon in the status tray - compressed and looking really distorted and ugly.

    I made a special 16x16 icon(in IDR_MAINFRAME), but i can't seem to figure out how to get the icon handle to it.

    I tried to use GetIcon(FALSE) but i still end up with the compressed 32x32 icon in the tray.

    Any hints?


    Thanks

  2. #2
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354
    Why don't u try adding another icon instead of adding a 16X16 to IDR_MAINFRAME ?

  3. #3
    Join Date
    Apr 2004
    Posts
    17
    hi
    you could try this two things (they worked for me in different situations).the first is:
    m_tnid.hIcon = AfxGetApp()->LoadIcon(IDI_ICON1); // user defined

    or instead try the LoadImage functions, that replaces LoadIcon, where one of the parameter is for image size (look at MSDN):

    hIcon = (HICON)::LoadImage((HINSTANCE)GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_LOFF),IMAGE_ICON,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON),0);

    regards,
    typecast

  4. #4
    Join Date
    May 2004
    Posts
    109
    I guess i'm forced to ask this stupid question... How do i make an icon with only a 16x16.. i haven't figured out how to delete the 32x32 that's created initially.


  5. #5
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354


    Need to do some searching!!

    Here.. open the icon in resource editor, now, in the device combo right at the top of the icon, select the one you want to delete.
    Then go to menu -> Image -> Delete device image.

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