flat assembler
Message board for the users of flat assembler.

Index > Windows > Toolbar trouble

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
What about this:
Code:
 .wm_notify:
                mov     ebx, [lparam]
                mov     eax, [hToolBar]
                cmp     [ebx], eax
                jne    @f
                invoke  MessageBox,NULL,_error,NULL,MB_ICONERROR+MB_OK
            @@: jmp    .finish0
    
Question
Post 31 Dec 2009, 18:50
View user's profile Send private message Visit poster's website Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 568
Location: Brazil
Teehee
i'm not sure. i think its working to ToolBar's Handle, but i need to get TBN_DROPDOWN notification.
Post 31 Dec 2009, 18:58
View user's profile Send private message Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 568
Location: Brazil
Teehee
Now, With the lesson of revolution, i get TBN_DROPDOWN notif.

Code:
  .wm_notify:
                mov     eax, [lparam]   ; [lparam] = pointer to NMHDR struct
                mov     ebx, [hToolBar]
                cmp     [eax+ NMHDR.hwndFrom],ebx
                jne    @f
                cmp     [eax+NMTOOLBAR.hdr.code],TBN_DROPDOWN 
                jne    @f
                ; detect which button was pressed
                ; cmp     [eax+NMTOOLBAR.iItem], ID_BUTTON (TBBUTTON.idCommand field)
            @@: jmp    .finish0    

Thank you rev. Very Happy


Last edited by Teehee on 02 Jan 2010, 14:34; edited 2 times in total
Post 01 Jan 2010, 13:24
View user's profile Send private message Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 568
Location: Brazil
Teehee
How can I put trasparent images on toolbar button?

I did:
Code:
;
; Create Image List : IDB_TEST = .bmp resource index
;

invoke  ImageList_Create, 32, 32, ILC_COLOR24, 1, 0  ; +ILC_MASK
mov     [hImageList], eax
invoke  SendMessage,[hToolBar],TB_SETIMAGELIST,0,[hImageList]
invoke  SendMessage,[hToolBar],TB_LOADIMAGES,  0,[hImageList]

invoke  LoadImage,[wc.hInstance],IDB_TEST,IMAGE_BITMAP,32,32,LR_DEFAULTCOLOR+LR_LOADTRANSPARENT
mov     ebx, eax  ; ebx = hImage
invoke  ImageList_Add,[hImageList],ebx,NULL
invoke  DeleteObject,ebx
    

LR_LOADTRANSPARENT does not making my image transparent.

(I tried with 3 differents background colors)

PS: using ILC_MASK it works, but i'd like to know if there is another simple way, like LR_LOADTRANSPARENT propose.
Post 01 Jan 2010, 15:33
View user's profile Send private message Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 568
Location: Brazil
Teehee
nvm..
I found this solution:
Code:
invoke  ImageList_LoadImage,[wc.hInstance],IDB_TEST,32,0,CLR_DEFAULT,IMAGE_BITMAP,LR_DEFAULTCOLOR+LR_CREATEDIBSECTION+LR_LOADTRANSPARENT
invoke  SendMessage,[hToolBar],TB_SETIMAGELIST,0,eax    
easier.
Post 01 Jan 2010, 16:46
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.