Listview Custom Draw
-
In the OnInitialUpdate function, you could call GetFont() and then analyze the members of the pointer it returns (CFont*). Something like this:
CFont* font = GetFont();
if (font)
{
LOGFONT lf;
font->GetLogFont(&lf);
TRACE("Typeface name of font = %s\n", lf.lfFaceName);
}To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
-
In the OnInitialUpdate function, you could call GetFont() and then analyze the members of the pointer it returns (CFont*). Something like this:
CFont* font = GetFont();
if (font)
{
LOGFONT lf;
font->GetLogFont(&lf);
TRACE("Typeface name of font = %s\n", lf.lfFaceName);
}To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
-
Custom-draw listview is free to choose as many fonts as it wants for painting different parts of the item area (in such case it skips the default drawing completely). Are you subclassing the listview in question? Tomasz Sowinski -- http://www.shooltz.com
-
Custom-draw listview is free to choose as many fonts as it wants for painting different parts of the item area (in such case it skips the default drawing completely). Are you subclassing the listview in question? Tomasz Sowinski -- http://www.shooltz.com
-
I am not using MFC so how would I do this just using the windows API? I am actually trying to determine whether the item is bold or not in the Outlook Express message list. Thank you for your response.
WM_GETFONT An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text. To send this message, call the SendMessage function with the following parameters. SendMessage( (HWND) hWnd, // handle to destination window WM_GETFONT, // message to send (WPARAM) wParam, // not used; must be zero (LPARAM) lParam // not used; must be zero ); Parameters This message has no parameters. Return Values The return value is a handle to the font used by the control, or NULL if the control is using the system font. Requirements Windows NT/2000 or later: Requires Windows NT 3.1 or later. Windows 95/98/Me: Requires Windows 95 or later. Header: Declared in Winuser.h; include Windows.h. After you get the HFONT, you can probably build a logfont to retrieve the info. To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
-
Well, assuming that this control only sets the font and lets COMCTL32 draw the items, you may try to install WH_CALLWNDPROCRET hook and inspect the font selected into DC after NM_CUSTOMDRAW. You'll have to check for correct custom-draw stage, probably CDDS_ITEMPREPAINT. BTW: why do you need this functionality? Tomasz Sowinski -- http://www.shooltz.com
-
WM_GETFONT An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text. To send this message, call the SendMessage function with the following parameters. SendMessage( (HWND) hWnd, // handle to destination window WM_GETFONT, // message to send (WPARAM) wParam, // not used; must be zero (LPARAM) lParam // not used; must be zero ); Parameters This message has no parameters. Return Values The return value is a handle to the font used by the control, or NULL if the control is using the system font. Requirements Windows NT/2000 or later: Requires Windows NT 3.1 or later. Windows 95/98/Me: Requires Windows 95 or later. Header: Declared in Winuser.h; include Windows.h. After you get the HFONT, you can probably build a logfont to retrieve the info. To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
-
Well, assuming that this control only sets the font and lets COMCTL32 draw the items, you may try to install WH_CALLWNDPROCRET hook and inspect the font selected into DC after NM_CUSTOMDRAW. You'll have to check for correct custom-draw stage, probably CDDS_ITEMPREPAINT. BTW: why do you need this functionality? Tomasz Sowinski -- http://www.shooltz.com