lmao
lmao

Reputation: 11

How to make the color of the parent and child window same?

I hardly know anything about windows.h library, but I have to make an application using it (long story). Anyways I would really appreciate if you can be patient with me on this one. My child window contains only some static text to be displayed on the parent window, but the colors are different how do I make them same? I have tried googling but i don't seem to get a hang of anything. Oh and I am using C++.

I saw this on MSDN

HRESULT EnableThemeDialogTexture( _In_ HWND hwnd, _In_ DWORD dwFlags );

but not sure where to use it.

My handle to the child window is start.

HRESULT EnableThemeDialogTexture(start,ETDT_DISABLE);

I tried this but I get errors such as

[Error] 'ETDT_DISABLE' was not declared in this scope

[Error] expression list treated as compound expression in initializer [-fpermissive]

i have my backgroud as

    wc.hbrBackground = (HBRUSH)(COLOR_GRADIENTINACTIVECAPTION+1);

my child window

switch(Message) 
{
    case WM_CREATE: 
    start = CreateWindow("STATIC","some text here",
    WS_VISIBLE|WS_CHILD,200,100,300,100,hwnd,NULL,NULL,NULL);       
    break;
    case WM_DESTROY: {
        PostQuitMessage(0);
        break;
    }

my parent window

hwnd = CreateWindowEx(WS_EX_CLIENTEDGE,"WindowClass","                                                                                        SHOPAHOLIC",
    WS_VISIBLE|WS_SYSMENU| WS_MINIMIZEBOX,
    CW_USEDEFAULT, /* x */
    CW_USEDEFAULT, /* y */
    740, /* width */
    580, /* height */
    NULL,NULL,hInstance,NULL);

Upvotes: 0

Views: 365

Answers (1)

user1610015
user1610015

Reputation: 6668

Handle the WM_CTLCOLORSTATIC message. (At the end of that page there's an example to do exactly what you're asking.)

Upvotes: 2

Related Questions