Ignore:
Timestamp:
Oct 17, 1999, 9:32:05 PM (26 years ago)
Author:
cbratschi
Message:

DrawIcon/DrawIconEx, fixed other icon handling problems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/static.cpp

    r1203 r1343  
    1 /* $Id: static.cpp,v 1.4 1999-10-08 21:26:08 cbratschi Exp $ */
     1/* $Id: static.cpp,v 1.5 1999-10-17 19:32:04 cbratschi Exp $ */
    22/*
    33 * Static control
     
    6363    STATICINFO *infoPtr = (STATICINFO *)GetInfoPtr(hwnd);
    6464    DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    65     INT cx,cy;
     65    ICONINFO ii;
     66    BITMAP bmp;
    6667
    6768    if ((dwStyle & SS_TYPEMASK) != SS_ICON) return 0;
     
    7172    infoPtr->hIcon = hicon;
    7273
    73     cx = GetSystemMetrics(SM_CXICON);
    74     cy = GetSystemMetrics(SM_CYICON);
    75 
    76     SetWindowPos(hwnd,0,0,0,cx,cy,SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
     74    GetIconInfo(hicon,&ii);
     75    GetObjectA(ii.hbmColor,sizeof(BITMAP),(LPVOID)&bmp);
     76
     77    SetWindowPos(hwnd,0,0,0,bmp.bmWidth,bmp.bmHeight,SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
    7778
    7879    return prevIcon;
     
    104105        SetWindowPos( hwnd, 0, 0, 0, bm.bmWidth, bm.bmHeight,
    105106                      SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
    106 /* CB: alternative code, if necessary
    107       HDC hdc = GetDC(hwnd);
    108       BITMAPINFO info;
    109 
    110       ZeroMemory(&info,sizeof(info));
    111       if (GetDIBits(hdc,hbitmap,0,0,NULL,&info,0) != 0)
    112       {
    113         SetWindowPos(hwnd,0,0,0,info.bmiHeader.biWidth,info.bmiHeader.biHeight,SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER);
    114       }
    115       ReleaseDC(hwnd,hdc);
    116 */
    117 
    118107    }
    119108    return hOldBitmap;
Note: See TracChangeset for help on using the changeset viewer.