Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Get Parent Color

Posted on 2004-04-16
3
Medium Priority
?
250 Views
Last Modified: 2013-11-20
Hi

I simple one which I can't figure out

I have a CMyStatic derived from a CStatic which is on a Dialog, how can I get the, CMyStatic to get the color of the dialog that its on
0
Comment
Question by:Dj_Fx8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Expert Comment

by:bkfirebird
ID: 10846932
try GetDC()->SetBkColor (GetParent()->GetDC()->GetBkColor ())
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 1000 total points
ID: 10847872
For any dialog which draws it's background by standard way, background color is returned by function GetSysColor(COLOR_BTNFACE).
If dialog code is custom and draws itself in WM_ERASEBKGND ot WM_PAINT handlers, it's impossible to get this color by generic way.
0
 
LVL 12

Expert Comment

by:migel
ID: 10848028
Hi!
IMHO you need to send WM_CTLCOLORSTATIC to the parent and examine brush being returned.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

596 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