The MASM Forum

General => The Campus => Topic started by: xandaz on June 10, 2013, 10:09:45 PM

Title: Black&White System Image List!
Post by: xandaz on June 10, 2013, 10:09:45 PM
   hey guys.... i'm trying to use the system imagelist to create a black and white alternative to it. BuildBWImageList    PROC    hWnd:DWORD

    local   hDC:DWORD
    local   hMemDC:DWORD
    local   hBitmap:DWORD
    local   cxIml:DWORD

    mov     tvis.hParent,0
    mov     tvis.hInsertAfter,TVI_LAST
    mov     tvis.item.imask,TVIF_IMAGE++TVIF_SELECTEDIMAGE
    invoke  GetDC,hWnd
    mov     hDC,eax
    invoke  CreateCompatibleDC,hDC
    mov     hMemDC,eax
    invoke  CreateCompatibleBitmap,hMemDC,cySysImlCheck
    mov     hBitmap,eax
    invoke  SelectObject,hMemDC,eax
    invoke  GetLogicalDriveStrings,sizeof TextBuffer/2,addr TextBuffer
    invoke  SHGetFileInfo,addr TextBuffer,addr shfi,sizeof shfi,SHGFI_SYSICONINDEX+SHGFI_SMALLICON
    mov     hSysIml,eax
    invoke  ImageList_GetImageCount,hSysIml
    dec     eax
    mov     cxIml,eax
    xor     ecx,ecx
loop_1:
    invoke  ImageList_Draw,hSysIml,0,hMemDC,0,0,ILD_NORMAL
       
             

    I'm stuck here. How does one then get the bitmap from hMemDC? Can someone help me out?
ty
Title: Re: Black&White System Image List!
Post by: dedndave on June 10, 2013, 11:54:32 PM
http://msdn.microsoft.com/en-us/library/windows/desktop/bb761389%28v=vs.85%29.aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/bb761389%28v=vs.85%29.aspx)
http://msdn.microsoft.com/en-us/library/windows/desktop/hh270414%28v=vs.85%29.aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/hh270414%28v=vs.85%29.aspx)

http://www.masmforum.com/board/index.php?topic=9964.msg73329#msg73329 (http://www.masmforum.com/board/index.php?topic=9964.msg73329#msg73329)
Title: Re: Black&White System Image List!
Post by: xandaz on June 11, 2013, 03:29:29 AM
thx a lot dave.
regs. x!