The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Tinieblaster on April 10, 2005, 08:42:44 PM

Title: back Color Buttons
Post by: Tinieblaster on April 10, 2005, 08:42:44 PM
hello, help please, as I can change the back color of bottom? please easily :'(
Title: Re: back Color Buttons
Post by: sluggy on April 11, 2005, 04:36:26 AM
Quote from: Tinieblaster on April 10, 2005, 08:42:44 PM
hello, help please, as I can change the back color of bottom? please easily :'(
Not of a bottom - they are kinda unchangeable  :toothy

To change the back colour of a button, check out the doco for it here (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/buttons/buttonreference/buttonmessages/wm_ctlcolorbtn.asp). Note that you can only do this on owner drawn buttons, not standard system ones.
Title: Re: back Color Buttons
Post by: Tinieblaster on April 11, 2005, 05:11:06 AM
that I have seen several times it... but I want to know as I apply to that with masm32... an example I need please.
Thank ::)
Title: Re: back Color Buttons
Post by: sluggy on April 11, 2005, 10:14:27 AM
Here is a very simple example from an app i wrote. This was actually for an edit control, but buttons are the same:


.ELSEIF uMsg == WM_CTLCOLORBTN
                             ...
                             ...a whole bunch of code went here...
                             ...

                             ;now colour the button:
invoke CreateSolidBrush, [esi]       ;ESI points to an already calculated COLORREF
mov dlgProcBrush, eax              ;i keep the brush so i can free it up later
ret                                                 ;return with the brush still in EAX



Title: Re: back Color Buttons
Post by: Tinieblaster on April 11, 2005, 12:50:07 PM
thank you very much, it will prove to see if with himself put it in march :U
Title: Re: back Color Buttons
Post by: Tinieblaster on April 11, 2005, 04:37:56 PM
Hello, because... I do not obtain it please. you can put I cosay for clumsy?  complete that works?  Thanks for your amiability. :'(
Title: Re: back Color Buttons
Post by: sluggy on April 11, 2005, 11:08:45 PM
Quote from: Tinieblaster on April 11, 2005, 04:37:56 PM
Hello, because... I do not obtain it please. you can put I cosay for clumsy?  complete that works?  Thanks for your amiability. :'(

No, that is not the way we run things here.... YOU post YOUR code, and we will assist with fixing it.

It is a very simple process, catch that particular windows message in your wndproc, create a brush, and return with it in the EAX register. Also, saying that "it doesn't work" is not a good enough description, you need to say WHAT happened, and any error messages you get (i.e. check GetLastError API function).

I realise that english is not your first language, if you tell us where you are from maybe someone here can help more by translating the answers you get.
Title: Re: back Color Buttons
Post by: Tinieblaster on April 12, 2005, 06:53:09 PM
Hello it excuses I did not want to bother, I cannot put my I code, since I do not have it,  I needed aid to be able to do I feel it if it bothers to somebody if that is not the subject of the forum, and is not English my language translates google I feel foot single I to be able to do that if nobody knows/does not want to help me, is no problem excuses and thanks for everything.