|
-
Mar 21st, 2002, 07:25 PM
#1
Thread Starter
Frenzied Member
text color
for now I use this function for font (thanks to a one mr parksie )
Code:
void SetFont(HWND hWnd, int iPointSize, const char *pcFontName) { //(obviously) sets fonts of controls
HFONT hTheFont;
HDC hDC = GetDC(hWnd);
int nHeight = -MulDiv(iPointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);
hTheFont = CreateFont(nHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, pcFontName);
ReleaseDC(hWnd, hDC);
SendMessage(hWnd, WM_SETFONT, (WPARAM)hTheFont, TRUE);
}
is there anyway to add a color parameter to this function? I don't know where to start...I've never used color
-
Mar 22nd, 2002, 01:28 PM
#2
No, not directly. You can use SetTextColor to set the color of text, but you must do it every time you retrieve a DC (for controls, that are the WM_CTLCOLOR* messages)
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|