News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

toolbar icon problem

Started by ragdog, July 08, 2007, 05:10:42 PM

Previous topic - Next topic

ragdog

I would like to  view from more files this icons in my toolbar

have your an idea?






invoke DoToolBar, hFileToolbar,addr szfile1, 0, 0
invoke DoToolBar, hFileToolbar,addr szfile2, 0, 0

DoToolBar proc hTBr:HWND,szFile:DWORD,IDd  :DWORD, Textd:DWORD
LOCAL    sfi:SHFILEINFO
LOCAL    tbb:TBBUTTON
LOCAL     id:DWORD

invoke SHGetFileInfo, szFile, NULL, addr sfi, sizeof SHFILEINFO,\
                       SHGFI_SYSICONINDEX or SHGFI_ICON or SHGFI_SMALLICON
                       
invoke SendMessage, hTBr, TB_BUTTONSTRUCTSIZE, sizeof TBBUTTON, 0
    mov ecx, 32
    mov eax, 32
    shl eax, 16
    mov ax, cx
invoke SendMessage, hTBr, TB_SETBITMAPSIZE, 0, eax

invoke ImageList_Create, 32, 32, ILC_MASK or ILC_COLORDDB, 32, 48 ;
    mov hImageList, eax
invoke ImageList_AddIcon, hImageList, sfi.hIcon

invoke SendMessage, hTBr, TB_SETIMAGELIST, 0, hImageList
invoke SendMessage, hTBr, TB_SETBUTTONSIZE, 32, 32

        mov tbb.iBitmap,0 ; Button image number
        mov edi,IDd
        mov tbb.idCommand,  edi ; Command ID number
        mov tbb.fsState, TBSTATE_ENABLED
        mov tbb.fsStyle, TBSTYLE_BUTTON
        mov tbb.dwData, 0
        mov tbb.iString, offset Text
     invoke SendMessage, hTBr, TB_ADDBUTTONS,1,addr tbb
        mov eax, hTBr

     invoke RtlZeroMemory,addr tbb,sizeof tbb
     invoke RtlZeroMemory,addr hImageList,sizeof hImageList
     invoke RtlZeroMemory,addr sfi,sizeof sfi
ret

DoToolBar endp


greets
ragdog