ANY ONE CAN TELL ME HOW TO USE WM_CTLCOLORBTN IN A PROCETURE IF I HAVE THREE BUSHBUTTON , HOW CAN I CHANGE THE COLOR TO ALL OF THEM.

.ELSEIF uMsg==WM_CTLCOLORBTN
.......................................................
......................................................
......................................................
an example would be better

THANKS
sudeer@37.com
Posted on 2002-02-15 07:02:24 by sudeer
sudeer,

Contrary to the documentation, I have never got a standard button to work with changed colours.



.elseif uMsg == WM_CTLCOLORBTN

invoke SetBkMode,wParam,OPAQUE
invoke SetBkColor,wParam,0000FF00h
invoke SetTextColor,wParam,0000FF00h

mov lb.lbStyle, BS_SOLID
mov lb.lbColor, 0000FF00h
mov lb.lbHatch, NULL

invoke CreateBrushIndirect,ADDR lb ; return is in eax
ret


This is the type of code that it should use, it just does not work. Maybe someone else has got it to work on win95 ?

Regards,

hutch@movsd.com
Posted on 2002-02-15 18:23:55 by hutch--
If I remember correctly WM_CTLCOLORBTN is for checkboxes, radio buttons and stuff like that. For push buttons you should use an owner drawn button.
Posted on 2002-02-15 21:27:52 by Soul~Drudge
may be i have to change some of the codes in this RC FILE
Here is my RC file if i include BS_OWNERDRAWN the button is going to disappear,i do not know what do you mean by an owner drawn button

IDD_ADD DIALOG 45,20,205,140 ;X ,Y ,WIDTH ,HIGHT
STYLE DS_MODALFRAME|WS_VISIBLE|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX
CAPTION "ADD NAME"
FONT 9, "MS Sans Serif"

BEGIN
GROUPBOX "",-1,3,1,195,70
CTEXT "Name ",12,10,12,40,11,SS_SYSGRP
EDITTEXT 413,60,12,130,12, ES_UPPERCASE
GROUPBOX "",-1,12,100,182,28
PUSHBUTTON "Yes" ,IDYES ,22,110,40,12,WS_CHILD
PUSHBUTTON "No" ,IDNO ,82,110,40,12,WS_CHILD
PUSHBUTTON "Cancel",IDCANCEL,142,110,40,12,WS_CHILD
END
regards,
sudeer@37.com
Posted on 2002-02-15 23:52:55 by sudeer

i do not know what do you mean by an owner drawn button

time to read your documentation. BS_OWNERDRAW button style,
and look up owner-drawn buttons in PlatformSDK.

Oh, and don't use "report this post to a moderator" the way you
just did... as the red text says:

This is ONLY to be used to report spam, advertising messages, and problematic (harassment, fighting, or rude) posts.
Posted on 2002-02-16 05:58:34 by f0dder
sudeer,

BS_OWNERDRAW style buttons are pretty crappy stuff leftover from win3.? A custom control is a better way to go. There are a few examples in MASM32 of custom buttons and a proper custom control in the MASM32 library that will handle different UP and DOWN bitmaps.

Regards,

hutch@movsd.com
Posted on 2002-02-16 08:25:43 by hutch--
hutch,
the SetBkColor will not work in a WM_CTLCOLORBTN message. Try using CreateSolidBrush instead, it should work fine.
Posted on 2002-02-17 04:24:37 by sluggy
Thanks for the suggestion sluggy but on my win95b, it just does not work.



.elseif uMsg == WM_CTLCOLORBTN
invoke CreateSolidBrush, 000000FFh
ret


Maybe its version specific ?

Regards,

hutch@movsd.com
Posted on 2002-02-17 04:38:31 by hutch--
hutch you really need to upgrade your operating system. dont get left behind im sure there are many people more than willing to sell there windows 2000 to you for a very cheap price since xp is out now.

sudeer : check out Ewayne's button example. here is his website: http://asmedit.massmind.org/
Posted on 2002-02-17 12:25:40 by smurf
hutch,
yep, you have to move out of the dark ages some time :)
Posted on 2002-02-17 14:24:56 by sluggy
I agree with Steve here and don't recomend him to be in a hurry changing OS.
For 9x most stable and fast is OSR2 95. (not 98 or M)
For NT - NT 4 (not NT5 AKA Win 2000)

I know all new Win32 OS well since I need to work with them.
All they another step to make things slower buggier, and impossible to comprehend.
Posted on 2002-02-17 14:37:56 by The Svin
There are some advantages in developing with an antique operating system, its no longer updated by Microsoft so its actually stable.

The main reason apart from the speed is that most computers around the world running 32 bit windows are running win95 on old hardware so writing stuff that does not work on the majority of computers is out.

Regards,

hutch@movsd.com
Posted on 2002-02-17 17:45:20 by hutch--

For 9x most stable and fast is OSR2 95. (not 98 or M)
For NT - NT 4 (not NT5 AKA Win 2000)

Upgrading to win98SE (not vanilla 98) from 95sr2 reduced my
crashes to a percentage. Also NULL pointer errors and the like
didn't bring down the system quite as often.

As for NT4 vs NT5... dunno if either is more stable than the
other, the only crashes I've had on NT5 is from bad drivers.
No matter how dirty my ring3 code has been, I've never made
anything but my own app crash. While boot is slow, the system
flies when it's booted. NT4 might be a bit faster, but it lacks
support for the latest DirectX and whatnot.


There are some advantages in developing with an antique operating system,
its no longer updated by Microsoft so its actually stable.

That is just bullshit and you should know better, hutch. An operating
system that randomly shits itself and can't handle null pointer errors...
I wouldn't exactly call that stable. And the reason it's not updated
anymore? It's obsolete and is being phased out.
Posted on 2002-02-18 03:19:00 by f0dder
I am not shure I understand what the fuzz is about.

MyProc proc arg:DWORD

LOCAL var:DWOED

call MySub
ret

MySub:

retn

MyProc endp


Does nothing weird and is fully recursive and is sometimes very useful.

KetilO

Oh, sorry, wrong thread.
Posted on 2002-02-18 03:25:00 by KetilO
Win2k isnt cheaper than WinXP here
Win2k = $500 aus
Winxp = $3** aus

You pay for the best ;)
Posted on 2002-02-18 04:48:42 by ThrawN
Hahahaha,

f0dder, stop trying to make me laugh.

===================
That is just bullshit and you should know better, hutch. An operating system that randomly shits itself and can't handle null pointer errors... I wouldn't exactly call that stable. And the reason it's not updated anymore? It's obsolete and is being phased out.
===================

I also have the last version released of win98se on a technically perfect P4 with 100 gig of disk space and 768 meg of ram and its a slow fragile pig with bad manners and other irritating glitches.

The version of NT4 I have on my old AMD is a lot better with service pack 6a in it. It only took !!!! 6 !!!! versions of service packs to get it right as it was another slow bad mannered pig that suffered from very poor hardware support and very ordinary peformance.

Is it strange that my PIII 600 is generally faster to use that my P4. Later box benchmarks better but is slow to use with its piggish interface and thats with all the junk turned off.

Nah, I run win95b because it faster and generally more reliable than others I have seen. I can also fix it in 5 minutes with a ghost image. Its main adbvantage though is that it is stable at last, everything works well and nothing else will be changed so as long as the majority of the world uses win95, I have a good reason to continue using it.

Its demise will be when my PIII dies and that will be some time yet.

ANOTHER Win2k bug. (Muhahahaha)

Loss of precision in floating point maths after calling "MessageBox".

I nearly died laughing.

Regards,

hutch@movsd.com
Posted on 2002-02-18 05:47:06 by hutch--
***Moves to "The Crusades"***



Oh wait, I'm not a mod. Oops.....never mind. Carry on. ;)
Posted on 2002-02-18 08:25:15 by Will
wakeup old man! someone needs to take your cane from you and whack you in the head!

its hard to teach an old dog new tricks hutch. i just wanted to let you know there's another world out there and if your willing to open up you might realize what your missing.

as far as your windows 98 is concered get rid of it as soon as you can. thats the most unrealiable windows os ive ever used. and if you do come out of your hole dont you dare get window me either, thats another bad situation all in its own.
Posted on 2002-02-18 10:48:54 by smurf
Steve, I just want let you know recalling the subj -
that code that didn't work on your OS(they gave you), wouldn't work on any new OSs with ordenary btn style.
And code they recomend you to see (Eyawen buttons tutor)
will work on your OS without any problem.
As for me the only problem with old OS - lack of support new
hardware and new DirectX.
I keep new OSs on my machine, only to get used to their NEW
problems and learn NEW recepies how to solve their NEW problems. 'Cause when admin in the firm surrenders in front of
new problem they usually send to me to deal with it, so I need to be upto scrach.
Posted on 2002-02-18 12:08:26 by The Svin
Alex,

Thanks for the info, I personally prefer custom controls for non standard buttons, works on all Windows versions and is a lot more flexible than tweaking system based stuff.

Smurf,

never fear, i will not go down the road of ME, it cannot normally be started up in DOS so I don't want it. My next box will probably have win2k after they succeed in debugging it properly, SP2 is clearly a flop and I refuse to pay for stuff that I have to debug the OS to get it going.

===============
wakeup old man! someone needs to take your cane from you and whack you in the head!
===============

You have to watch us "old fellas", we full of surprises. Years ago when I had a broken leg from a motorcycle accident, I had to use a cane occasionally while I was recovering and there are a very useful set of defence techniques using a walking cane. :tongue:

Regards,

hutch@movsd.com
Posted on 2002-02-18 19:27:21 by hutch--