heres a nice tutorial about regions: http://www.flipcode.com/archives/Win32_Window_Skinning.shtml
like you see, these tutorial is for forms.. so how we can do with child controls!?!
we can:
add the WS_CLIPCHILDREN or WS_CLIPSIBLINGS style, when we create a button\other control:

hwnd = CreateWindowEx(
                0,
                TEXT("CBUTTON"),
                strCaption.c_str(),
                WS_CHILD | WS_VISIBLE | BS_TEXT | WS_TABSTOP | BS_NOTIFY | WS_CLIPCHILDREN,
                intLeft, intTop, intWidth, intHeight,
                parent,
                NULL,
                mod,
                (LPVOID)this);

now i'm do anotherthing... instead normal shapes i want in image way: testing all pixels and 'avoid' 1 color:

HRGN HideBackcolor(HWND WindowHandle,color BackColor=-1)
{     
    HDC hdc=GetDC(WindowHandle);
    if(BackColor==-1)
        BackColor=GetPixel(hdc,0,0);
    HRGN regionold=NULL,regionnew=NULL;
    int x=0,y=0;
    RECT a;
    GetWindowRect(WindowHandle,&a);
    int width=a.right - a.left -1;
    int height=a.bottom - a.top -1;
    for (y=0; y<height; y++)
    {
        for(x=0; x<width; x++)
        {
            color b=GetPixel(hdc,x,y);
            if(b!=BackColor)
            {
                regionnew=CreateRectRgn(x,y,x+1,y+1);
                CombineRgn(regionold, regionold, regionnew, RGN_OR);
            }
        }
    }
    return regionold;
}

i belive that i have some problems with these code, maybe i'm confused with CombineRgn() function. because i get bad results(i mean what i see):(
the color isn't hide :(
so what i'm doing wrong?

The only way to skin and draw child controls is to use the BS_OWNERDRAW flag and draw the control yourself.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.