Problem Using Custom Windows Controls

I play with drawing my own custom controls using the uxTheme library on Windows, and I can't understand why my control is not like a regular Windows control that (presumably) uses the same theme, m, using:

A Windows ComboBox and my control that uses the ComboBox theme

The above image shows the standard Windows ComboBox (top) and my custom control created using the ComboBox theme (bottom). What I cannot decide is why the border of my control differs from the standard shape and color.

In my class constructor, I open topic data:

mComboTheme = OpenThemeData( hwnd, L"COMBOBOX" );

And then in the WM_PAINT handler, I just draw two parts of the ComboBox components:

case WM_PAINT:
{
    PAINTSTRUCT ps;
    HDC         hdc;
    RECT        client;

    if( GetUpdateRect( hwnd, &ps.rcPaint, false ))
    {
        hdc = BeginPaint( hwnd, &ps );
        GetClientRect( hwnd, &client );

        if( IsThemeBackgroundPartiallyTransparent( mComboTheme, CP_BACKGROUND, CBXS_HOT ))
        {
            DrawThemeParentBackground( hwnd, hdc, &ps.rcPaint );
        }
        DrawThemeBackground( mComboTheme, hdc, CP_BACKGROUND, CBXS_HOT, &client, &ps.rcPaint );
        client.left = client.right - 20;
        DrawThemeBackground( mComboTheme, hdc, CP_DROPDOWNBUTTONRIGHT, CBXSR_HOT, &client, ps.rcPaint );

        EndPaint( *this, &ps );
    }
    break;
}

, , .

,

+3
1

DrawThemeBackground CP_BACKGROUND CP_DROPDOWNBUTTONRIGHT. , CP_BORDER, , ?

+4

All Articles