Ignore:
Timestamp:
Sep 20, 1999, 6:04:44 PM (26 years ago)
Author:
cbratschi
Message:

DrawText fix

File:
1 edited

Legend:

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

    r949 r989  
    1 /* $Id: static.cpp,v 1.1 1999-09-15 23:18:55 sandervl Exp $ */
     1/* $Id: static.cpp,v 1.2 1999-09-20 16:04:44 cbratschi Exp $ */
    22/*
    33 * Static control
     
    9292
    9393    if (hBitmap && GetObjectType(hBitmap) != OBJ_BITMAP) {
    94         //ERR("huh? hBitmap!=0, but not bitmap\n");
    95         return 0;
     94        //ERR("huh? hBitmap!=0, but not bitmap\n");
     95        return 0;
    9696    }
    9797    hOldBitmap = infoPtr->hIcon;
     
    102102        GetObjectA(hBitmap, sizeof(bm), &bm);
    103103        SetWindowPos( hwnd, 0, 0, 0, bm.bmWidth, bm.bmHeight,
    104                       SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
     104                      SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
    105105/* CB: alternative code, if necessary
    106106      HDC hdc = GetDC(hwnd);
     
    113113      }
    114114      ReleaseDC(hwnd,hdc);
    115 */                     
    116                
     115*/
     116
    117117    }
    118118    return hOldBitmap;
     
    471471      text = (char*)malloc(textLen);
    472472      GetWindowTextA(hwnd,text,textLen);
     473      SetBkMode(hdc,TRANSPARENT);
    473474      DrawTextA( hdc, text, -1, &rc, wFormat );
    474475      free(text);
     
    545546    if (infoPtr->hIcon) {
    546547        BITMAP bm;
    547         SIZE sz;
     548        SIZE sz;
    548549
    549550        if(GetObjectType(infoPtr->hIcon) != OBJ_BITMAP)
    550             return;
     551            return;
    551552        if (!(hMemDC = CreateCompatibleDC( hdc ))) return;
    552         GetObjectA(infoPtr->hIcon, sizeof(bm), &bm);
    553         GetBitmapDimensionEx(infoPtr->hIcon, &sz);
    554         oldbitmap = SelectObject(hMemDC, infoPtr->hIcon);
    555         BitBlt(hdc, sz.cx, sz.cy, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0,
    556                SRCCOPY);
    557         SelectObject(hMemDC, oldbitmap);
    558         DeleteDC(hMemDC);
     553        GetObjectA(infoPtr->hIcon, sizeof(bm), &bm);
     554        GetBitmapDimensionEx(infoPtr->hIcon, &sz);
     555        oldbitmap = SelectObject(hMemDC, infoPtr->hIcon);
     556        BitBlt(hdc, sz.cx, sz.cy, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0,
     557               SRCCOPY);
     558        SelectObject(hMemDC, oldbitmap);
     559        DeleteDC(hMemDC);
    559560    }
    560561}
Note: See TracChangeset for help on using the changeset viewer.