Skip to content
Snippets Groups Projects
Commit 3c56550e authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard
Browse files

msi: Read the font color from the database, and use it for the text control.

parent 7c35db00
No related branches found
No related tags found
No related merge requests found
......@@ -71,6 +71,7 @@ typedef struct msi_font_tag
{
struct msi_font_tag *next;
HFONT hfont;
COLORREF color;
WCHAR name[1];
} msi_font;
......@@ -243,6 +244,8 @@ static UINT msi_dialog_add_font( MSIRECORD *rec, LPVOID param )
font->next = dialog->font_list;
dialog->font_list = font;
font->color = MSI_RecordGetInteger( rec, 4 );
memset( &lf, 0, sizeof lf );
face = MSI_RecordGetString( rec, 2 );
lf.lfHeight = MSI_RecordGetInteger( rec, 3 );
......@@ -563,6 +566,7 @@ static msi_control *msi_dialog_add_control( msi_dialog *dialog,
struct msi_text_info
{
msi_font *font;
WNDPROC oldproc;
DWORD attributes;
};
......@@ -592,6 +596,9 @@ MSIText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
info = GetPropW(hWnd, szButtonData);
if ( info->font )
SetTextColor( (HDC)wParam, info->font->color );
if( msg == WM_CTLCOLORSTATIC &&
( info->attributes & msidbControlAttributesTransparent ) )
{
......@@ -619,6 +626,8 @@ static UINT msi_dialog_text_control( msi_dialog *dialog, MSIRECORD *rec )
{
msi_control *control;
struct msi_text_info *info;
LPCWSTR text, ptr;
LPWSTR font_name;
TRACE("%p %p\n", dialog, rec);
......@@ -630,6 +639,11 @@ static UINT msi_dialog_text_control( msi_dialog *dialog, MSIRECORD *rec )
if( !info )
return ERROR_SUCCESS;
text = MSI_RecordGetString( rec, 10 );
font_name = msi_dialog_get_style( text, &ptr );
info->font = ( font_name ) ? msi_dialog_find_font( dialog, font_name ) : NULL;
msi_free( font_name );
info->attributes = MSI_RecordGetInteger( rec, 8 );
if( info->attributes & msidbControlAttributesTransparent )
SetWindowLongPtrW( control->hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment