Copyright © 2002-2009 MultiMedia Soft 
Return to index  
 
abmGetFontText function 
 
Remarks
Given a text position, retrieves its font settings: this information can be modified using the abmSetFontText function.
Return value
None.
Syntax
void abmGetFontText
HWND hWndBtn
short nPosition, 
void *pLogFont 
); 
 
 
Parameters
Description
hWndBtn
Windows handle associated to the button.
nPosition
The numeric value of the text whose font settings will be retrieved. Supported values are the following: 
Mnemonic constant
Meaning
TEXTPOS_CAPTION (0)
Gets the caption text font settings
TEXTPOS_LT (1)
Gets the Left-Top text font settings
TEXTPOS_CT (2)
Gets the Center-Top text font settings
TEXTPOS_RT (3)
Gets the Right-Top text font settings
TEXTPOS_LM (4)
Gets the Left-Middle text font settings
TEXTPOS_RM (5)
Gets the Right-Middle text font settings
TEXTPOS_LB (6)
Gets the Left-Bottom text font settings
TEXTPOS_CB (7)
Gets the Center-Bottom text font settings
TEXTPOS_RB (8)
Gets the Right-Bottom text font settings
pLogFont
Address of the the LOGFONT structure that in output will contain the font settings.
 
Visual Basic example 
 
' obtain the current font settings 
Dim lf As LOGFONT 
abmGetFontText btn1.hWnd, TEXTPOS_CAPTION, lf 
 
' change the needed fields only 
lf.lfItalic = True 
lf.lfFaceName = "Times New Roman" 
 
send the new font settings to the control 
abmSetFontText btn1.hWnd, TEXTPOS_CAPTION, lf 
With this code, after the call to the abmSetFontText function, the caption font of the button btn1 will be italic and Times New Roman. 
 
Visual C++ example 
 
// obtain the current font settings 
LOGFONT lf; 
abmGetFontText (btn1.GetSafeHwnd (), TEXTPOS_CAPTION, &lf); 
 
// change the needed fields only 
lf.lfItalic = TRUE; 
strcpy (lf.lfFaceName, "Times New Roman"); 
 
// send the new font settings to the control 
abmSetFontText (btn1.GetSafeHwnd (), TEXTPOS_CAPTION, &lf); 
 
 
 
 
 
 
 
Copyright © 2002-2009 MultiMedia Soft 
Return to index