Click here to Skip to main content
15,914,416 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Need tools / techniques for tracing GDI leakage Pin
Christian Graus16-Oct-01 12:38
protectorChristian Graus16-Oct-01 12:38 
GeneralRe: Need tools / techniques for tracing GDI leakage Pin
Jase Jennings16-Oct-01 12:49
Jase Jennings16-Oct-01 12:49 
GeneralRe: Need tools / techniques for tracing GDI leakage Pin
Christian Graus16-Oct-01 12:56
protectorChristian Graus16-Oct-01 12:56 
GeneralRe: Need tools / techniques for tracing GDI leakage Pin
Jase Jennings16-Oct-01 21:55
Jase Jennings16-Oct-01 21:55 
GeneralRe: Need tools / techniques for tracing GDI leakage Pin
James Spibey1-Nov-01 0:21
James Spibey1-Nov-01 0:21 
GeneralTransparent button disable other functions :( Pin
16-Oct-01 2:09
suss16-Oct-01 2:09 
GeneralRe: Transparent button disable other functions :( Pin
RobJones16-Oct-01 9:35
RobJones16-Oct-01 9:35 
GeneralSOS: changing fonts of controls in dialog Pin
tfElep15-Oct-01 23:28
tfElep15-Oct-01 23:28 
Texts in titles of all windows are getting smaller and smaller when I have the fonts of controls in one window such as buttons and statics changed. I wonder how the operation on this window affulent all the windows on desktop ---- the whole OS, even after this window has exited.

my code is below:

// CDlg is derived from CDialog
BOOL CDlg::OnInitDialog(){
CDialog::OnInitDialog();
// m_button is a child button in CDlg
SetFont(&m_button, "Times New Roman", 12); // see below
m_button.SetFocus();
return false
}

CDlg::SetFont(CWnd* pWnd, char* strFont, int nSize){
CFont font;
LOGFONT logFont;
memset(&logFont, 0, sizeof(logFont));
logFont.lfHeight=-nSize;
logFont.CharSet=DEFAULT_CHARSET;
strcpy((char*)logFont.lfFaceName, strFont);
font.CreateFontIndirect(&logFont);
pWnd->SetFont(&font);
}

Maybe I should have keep the "font" variable until the dialog is ended, but the problem above still exists when I allocate memory from heap (malloc()) for "font" and "logFont". Can you change the fonts of all windows on desktop?
Smile | :)

Tiny Flying Elephant
I love flying...
GeneralRe: SOS: changing fonts of controls in dialog Pin
Michael Martin16-Oct-01 1:33
professionalMichael Martin16-Oct-01 1:33 
GeneralRe: SOS: changing fonts of controls in dialog Pin
Tomasz Sowinski16-Oct-01 1:34
Tomasz Sowinski16-Oct-01 1:34 
GeneralFocus problem Pin
Nick Armstrong15-Oct-01 22:48
Nick Armstrong15-Oct-01 22:48 
GeneralRe: Focus problem Pin
Tomasz Sowinski16-Oct-01 1:28
Tomasz Sowinski16-Oct-01 1:28 
GeneralRe: Focus problem Pin
Nick Armstrong17-Oct-01 1:25
Nick Armstrong17-Oct-01 1:25 
QuestionDifference between New and Malloc ? Pin
15-Oct-01 22:40
suss15-Oct-01 22:40 
AnswerRe: Difference between New and Malloc ? Pin
markkuk16-Oct-01 1:04
markkuk16-Oct-01 1:04 
GeneralRe: Difference between New and Malloc ? Pin
Tomasz Sowinski16-Oct-01 1:21
Tomasz Sowinski16-Oct-01 1:21 
AnswerRe: Difference between New and Malloc ? Pin
Tomasz Sowinski16-Oct-01 1:10
Tomasz Sowinski16-Oct-01 1:10 
GeneralRe: Difference between New and Malloc ? Pin
16-Oct-01 5:53
suss16-Oct-01 5:53 
AnswerRe: found out the problem Pin
yarp16-Oct-01 8:31
yarp16-Oct-01 8:31 
GeneralRegister my OLE/COM object Pin
15-Oct-01 22:00
suss15-Oct-01 22:00 
GeneralRe: Register my OLE/COM object Pin
Christian Graus15-Oct-01 22:45
protectorChristian Graus15-Oct-01 22:45 
Generalthank you ! Can you explain me some things ? Pin
15-Oct-01 23:18
suss15-Oct-01 23:18 
GeneralRe: thank you ! Can you explain me some things ? Pin
Christian Graus15-Oct-01 23:46
protectorChristian Graus15-Oct-01 23:46 
GeneralRegister my OLE/COM object Pin
15-Oct-01 23:40
suss15-Oct-01 23:40 
GeneralRe: Register my OLE/COM object Pin
Christian Graus16-Oct-01 0:20
protectorChristian Graus16-Oct-01 0:20 

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.