Click here to Skip to main content
15,919,132 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Quick OnInitDialog q'n Pin
Prakash Nadar17-Nov-03 16:02
Prakash Nadar17-Nov-03 16:02 
GeneralRe: Quick OnInitDialog q'n Pin
Michael Dunn17-Nov-03 20:04
sitebuilderMichael Dunn17-Nov-03 20:04 
QuestionDoes it have some memory leak? Pin
Joise17-Nov-03 14:56
Joise17-Nov-03 14:56 
AnswerRe: Does it have some memory leak? Pin
Dave Bryant17-Nov-03 15:07
Dave Bryant17-Nov-03 15:07 
GeneralRe: Does it have some memory leak? Pin
Joise17-Nov-03 15:13
Joise17-Nov-03 15:13 
AnswerRe: Does it have some memory leak? Pin
Brian Shifrin17-Nov-03 15:10
Brian Shifrin17-Nov-03 15:10 
GeneralRe: Does it have some memory leak? Pin
Joise17-Nov-03 15:14
Joise17-Nov-03 15:14 
GeneralChanging Dialog Font Programmatically Pin
yoshibebe17-Nov-03 14:55
yoshibebe17-Nov-03 14:55 
Hi,

I am trying to change the dialog font programmatically. The dialog right now is created using a Resource file, and the font size and face is hard-coded. I would like to be able to change the font face and size in the OnInitDialog() function. So far this is what I have:


HFONT hFont;
LOGFONT lf;
CFont pFont;
short int fRedraw= FALSE;


memset(&lf, 0, sizeof(LOGFONT));

hFont = (HFONT) GetStockObject( SYSTEM_FONT );

GetObject(hFont, sizeof(lf), &lf);

pFont.CreateFontIndirect(&lf);

this->SetFont(&pFont, true);

SendMessageToDescendants(WM_SETFONT, (WPARAM)pFont.m_hObject, MAKELONG ((WORD) fRedraw, 0), TRUE);


This is changing the font size and face for the CONTROLS of the dialog. However, it does not change anything elose besides that.

I tried to do a this->SetFont, however, this does not help. I need the dialog itself to be resized accordingly, and also regular CText. When the font is changed in the resource file, I notice that the dialog size itself changes, however, this is not happening when I call SetFont or send a WM_SETFONT message.

Can anyone help me?

Thanks!!!
GeneralRe: Changing Dialog Font Programmatically Pin
Stye18-Nov-03 16:16
Stye18-Nov-03 16:16 
GeneralRe: Changing Dialog Font Programmatically Pin
Anonymous24-Nov-03 8:28
Anonymous24-Nov-03 8:28 
Questionhow to get gdiplus.chm Pin
zecodela17-Nov-03 14:45
zecodela17-Nov-03 14:45 
GeneralWindows Media CD Ripping Pin
benglish7217-Nov-03 13:52
benglish7217-Nov-03 13:52 
QuestionIs it possible to connect to a database using only the connect string? Pin
ElizabethC17-Nov-03 12:55
ElizabethC17-Nov-03 12:55 
AnswerRe: Is it possible to connect to a database using only the connect string? Pin
Brian Shifrin17-Nov-03 14:47
Brian Shifrin17-Nov-03 14:47 
GeneralHelp Pin
wendigo_8317-Nov-03 12:38
susswendigo_8317-Nov-03 12:38 
GeneralRe: Help Pin
Mike Danberg17-Nov-03 12:44
Mike Danberg17-Nov-03 12:44 
GeneralRe: Help Pin
Christian Graus17-Nov-03 15:20
protectorChristian Graus17-Nov-03 15:20 
GeneralRe: Help Pin
Mike Dimmick18-Nov-03 2:52
Mike Dimmick18-Nov-03 2:52 
GeneralHelp Pin
Anonymous17-Nov-03 12:37
Anonymous17-Nov-03 12:37 
GeneralRe: Help Pin
murali_utr17-Nov-03 17:29
murali_utr17-Nov-03 17:29 
GeneralEnabling/Disabling Menu Items Pin
mdurfee17-Nov-03 12:10
mdurfee17-Nov-03 12:10 
GeneralRe: Enabling/Disabling Menu Items Pin
Mike Danberg17-Nov-03 12:51
Mike Danberg17-Nov-03 12:51 
GeneralRe: Enabling/Disabling Menu Items Pin
Michael Dunn17-Nov-03 20:07
sitebuilderMichael Dunn17-Nov-03 20:07 
GeneralProgramming I/O for usb devices Pin
haritadala17-Nov-03 11:35
haritadala17-Nov-03 11:35 
GeneralRe: Programming I/O for usb devices Pin
Peter Molnar18-Nov-03 15:10
Peter Molnar18-Nov-03 15:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.