Click here to Skip to main content
15,913,199 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralLibrary Not Registered Pin
qur30-May-03 3:21
qur30-May-03 3:21 
GeneralRe: Library Not Registered Pin
Nick Parker30-May-03 18:58
protectorNick Parker30-May-03 18:58 
GeneralRe: Library Not Registered Pin
qur1-Jun-03 21:44
qur1-Jun-03 21:44 
GeneralRe: Library Not Registered Pin
Vi25-Jun-03 0:47
Vi25-Jun-03 0:47 
GeneralRe: Library Not Registered Pin
qur6-Jun-03 0:13
qur6-Jun-03 0:13 
GeneralRe: Library Not Registered Pin
Vi26-Jun-03 2:11
Vi26-Jun-03 2:11 
GeneralIcon to Bitmap conversion Pin
Bara Sab30-May-03 2:21
Bara Sab30-May-03 2:21 
GeneralRe: Icon to Bitmap conversion Pin
Ed Gadziemski30-May-03 9:44
professionalEd Gadziemski30-May-03 9:44 
HBITMAP BitmapFromIconCursor(HICON hIconCursor, HWND hWnd)
{
    ICONINFO iconInfo;
    ::GetIconInfo(hIconCursor, &iconInfo);

    BITMAP bm;
    ::GetObject(iconInfo.hbmMask, sizeof(bm), &bm);

// for a monochrome icon/cursor: top half of mask is AND segment,
// bottom half is XOR segment, so use width as cy value
    int cy = bm.bmHeight;
    if (cy == 2 * bm.bmWidth) cy = bm.bmWidth;

    CClientDC hdc(hWnd);
    CDC hdcMem = ::CreateCompatibleDC(hdc);

// combine the icon's mask and color bitmaps into one
    HBITMAP oldBmp = hdcMem.SelectBitmap(iconInfo.hbmColor);
    hdc.MaskBlt(0, 0, bm.bmWidth, cy, hdcMem, 0, 0, iconInfo.hbmMask, 0, cy, MAKEROP4(SRCINVERT, SRCAND));

// make a copy of the combined bitmap
    HBITMAP hBmpCopy;
    if (iconInfo.hbmColor != NULL)
        hBmpCopy = ::CreateCompatibleBitmap(hdc, bm.bmWidth, cy);
    else // monochrome bitmap
        hBmpCopy = ::CreateBitmap(bm.bmWidth, cy, bm.bmPlanes, bm.bmBitsPixel, NULL);

    hdcMem.SelectBitmap(hBmpCopy);
    hdcMem.BitBlt(0, 0, bm.bmWidth, cy, hdc, 0, 0, SRCCOPY);

// clean up
    hdcMem.SelectBitmap(oldBmp);
    ::DeleteObject(iconInfo.hbmMask);
    ::DeleteObject(iconInfo.hbmColor);

    return hBmpCopy;
}

GeneralRe: Icon to Bitmap conversion Pin
Michael Dunn30-May-03 11:30
sitebuilderMichael Dunn30-May-03 11:30 
GeneralRe: Icon to Bitmap conversion Pin
Ed Gadziemski4-Jun-03 13:14
professionalEd Gadziemski4-Jun-03 13:14 
GeneralRe: Icon to Bitmap conversion Pin
Michael Dunn4-Jun-03 15:32
sitebuilderMichael Dunn4-Jun-03 15:32 
GeneralRe: Icon to Bitmap conversion Pin
Ed Gadziemski4-Jun-03 16:32
professionalEd Gadziemski4-Jun-03 16:32 
GeneralI'm a beginner.... Pin
Jhon29-May-03 15:08
Jhon29-May-03 15:08 
GeneralRe: I'm a beginner.... Pin
Anonymous29-May-03 16:51
Anonymous29-May-03 16:51 
GeneralRe: I'm a beginner.... Pin
geo_m30-May-03 22:20
geo_m30-May-03 22:20 
GeneralRe: I'm a beginner.... Pin
sunjohn1-Jun-03 22:43
sunjohn1-Jun-03 22:43 
GeneralCompilation Error on map Pin
projyal27-May-03 21:16
projyal27-May-03 21:16 
GeneralRe: Compilation Error on map Pin
projyal27-May-03 22:05
projyal27-May-03 22:05 
GeneralRe: Compilation Error on map Pin
Joaquín M López Muñoz28-May-03 2:30
Joaquín M López Muñoz28-May-03 2:30 
Generaladd a DIALOGBAR Pin
aguest27-May-03 19:37
aguest27-May-03 19:37 
GeneralWTL: CFrameWindow question Pin
João Paulo Figueira27-May-03 1:28
professionalJoão Paulo Figueira27-May-03 1:28 
QuestionHow to Implement "Drag" in List View without using MFC Pin
Pious26-May-03 22:00
Pious26-May-03 22:00 
AnswerRe: How to Implement "Drag" in List View without using MFC Pin
AlexO27-May-03 6:30
AlexO27-May-03 6:30 
QuestionATL CString in C++ .net/2003 - to export or not? Pin
Peter Weyzen26-May-03 18:45
Peter Weyzen26-May-03 18:45 
AnswerRe: ATL CString in C++ .net/2003 - to export or not? Pin
27-May-03 7:35
suss27-May-03 7:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.