Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 253
  • Last Modified:

Get Parent Color

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
Dj_Fx8
Asked:
Dj_Fx8
1 Solution
 
bkfirebirdCommented:
try GetDC()->SetBkColor (GetParent()->GetDC()->GetBkColor ())
0
 
AlexFMCommented:
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
 
migelCommented:
Hi!
IMHO you need to send WM_CTLCOLORSTATIC to the parent and examine brush being returned.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now