View previous topic :: View next topic |
Author |
Message |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Wed Apr 30, 2008 4:24 am Post subject: Font of Static text |
|
|
I've started at some simple gui creation using "CreateWindow()" function, and im wondering, if it is possible to change the font of the text, that is created when you make a "CreateWindow('static',...)"?
did i say, that it was in C++?
|
|
Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
|
Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Wed Apr 30, 2008 5:23 am Post subject: |
|
|
This is my code.
HFONT hfFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
The default font will be better looking than SYSTEM for the rest of the APP
_________________
|
|
Back to top |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Wed Apr 30, 2008 5:27 am Post subject: |
|
|
And if i wish to change the size of my font?
|
|
Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Wed Apr 30, 2008 6:28 am Post subject: |
|
|
HFONT CreateFont(
int nHeight,
int nWidth,
int nEscapement,
int nOrientation,
int fnWeight,
DWORD fdwItalic,
DWORD fdwUnderline,
DWORD fdwStrikeOut,
DWORD fdwCharSet,
DWORD fdwOutputPrecision,
DWORD fdwClipPrecision,
DWORD fdwQuality,
DWORD fdwPitchAndFamily,
LPCTSTR lpszFace
);
|
|
Back to top |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Wed Apr 30, 2008 6:33 am Post subject: |
|
|
Symbol wrote: | HFONT CreateFont(
int nHeight,
int nWidth,
int nEscapement,
int nOrientation,
int fnWeight,
DWORD fdwItalic,
DWORD fdwUnderline,
DWORD fdwStrikeOut,
DWORD fdwCharSet,
DWORD fdwOutputPrecision,
DWORD fdwClipPrecision,
DWORD fdwQuality,
DWORD fdwPitchAndFamily,
LPCTSTR lpszFace
); |
Of curse..., but when applying it as HFONT, will it then change all the fonts in my project?
|
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Wed Apr 30, 2008 7:24 am Post subject: |
|
|
Creating the font only gives the font handle to a certain HFONT. Whether it changes the font on certain objects is your job.
sending the WM_SETFONT Message with the wParam being (WPARAM)hFont (or w/e you named the handle to the font) will set the font on a certain hWnd Object.
_________________
|
|
Back to top |
|
 |
|