Solved

Color of selected push-like check buttons

Posted on 1997-08-13
6
476 Views
Last Modified: 2013-11-19
I would like to retrieve the color used for filling
a selected push-like check button.

1) Is it a solid color, or some sort of stippling?
2) If color, is there a way to get it with GetSysColor
   (none of the macros correspond).
3) Is it possible to calculate it, given the BTNFACE color?

Any answer which will explain how Windows draws the push
style check button, will be welcome.
0
Comment
Question by:mco
6 Comments
 
LVL 3

Expert Comment

by:byang
ID: 1303721
What's a "push style check button" ? Do you mean:
1. regular checkbox (square box at the left), or
2. radio checkbox (circle at the left), or
3. regular button with a checkmark on it

0
 
LVL 7

Expert Comment

by:galkin
ID: 1303722
Id this button is standard you can get button face color by calling GetSysColor(COLOR_BTNFACE), light color by calling GetSysColor(COLOR_3DLIGHT),and shadow color by calling GetSysColor(COLOR_3DSHADOW).
0
 
LVL 1

Author Comment

by:mco
ID: 1303723
No, this does not work. I looked at the value of
COLOR_3DLIGHT for many color schemes and it is equal to
the value of COLOR_BTNFACE. Visually, these are two different
colors where the selected check button color is lighter
but similar. It is darker, though, than COLOR_3DHILIGHT used for the light shadow edge.
COLOR_3DSHADOW is the dark shadow edge that is even darker than
COLOR_BTNFACE.


To answer byang's question:
I do not mean any of the 3 you stated.
I mean a button with the style BS_AUTOCHECKBOX | BS_PUSHLIKE .
This is what you get when in Visual C++ resource editor
you create a check box and select the "push-like" attribute.
On the button you have the button's text.


0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 10

Expert Comment

by:RONSLOW
ID: 1303724
Have a look at DrawFrameControl which draws all sorts of buttons in various states.  Also look at DrawState.


0
 
LVL 1

Author Comment

by:mco
ID: 1303725
RONSLOW, playing around with DrawState brought me
to see that the selected check buttons are drawn
with the same color but DITHERED. Actually that can be done more easily using GetHalftoneBrush(), since I am using one color.

Since the purpose of my question was to understand how
Windows chooses the color, I have the complete answer.

You wrote it as a comment. If you write it (or something)
again as an ANSWER, I will award you all the possible points.


0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 120 total points
ID: 1303726
Here you go - thanks for the points :-)

Have a look at DrawFrameControl which draws all sorts of buttons in various states. Also look at DrawState.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 120
deburging in oracle form 12 88
VBA "SendKeys" Syntax for Multiple Keystrokes 7 103
withoutTen challenge 14 99
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now