geting font from hdc (GDI) in API way
-
Hi i want to get HFONT or LOGFONT form HDC object. I have a hdc but i don't wann to do this in this way
HFONT font= (HFONT)SendMessage( hwnd,WM_GETFONT,0,0);
or in this wayHFONT font = ::CreateFontIndirect(....); HFONT hOldFont = (HFONT)::SelectObject(hdc, font);
im looking for something likeHFONT font=GetFont(hdc);
There must be a way to do this:mad: Pain is a weakness living the body -
Hi i want to get HFONT or LOGFONT form HDC object. I have a hdc but i don't wann to do this in this way
HFONT font= (HFONT)SendMessage( hwnd,WM_GETFONT,0,0);
or in this wayHFONT font = ::CreateFontIndirect(....); HFONT hOldFont = (HFONT)::SelectObject(hdc, font);
im looking for something likeHFONT font=GetFont(hdc);
There must be a way to do this:mad: Pain is a weakness living the bodyTry
::GetCurrentObject(HDC, OBJ_FONT)
Roger Allen - Sonork 100.10016 Strong Sad: Clever I am? Next to no one. Undiscovered and soggy. Look up. Look down. They're around. Probably laughing. Still, bright, watery. Listed among the top. Ten. Nine. Late night. Early morn. Early mourn. Now I sleep. -
Hi i want to get HFONT or LOGFONT form HDC object. I have a hdc but i don't wann to do this in this way
HFONT font= (HFONT)SendMessage( hwnd,WM_GETFONT,0,0);
or in this wayHFONT font = ::CreateFontIndirect(....); HFONT hOldFont = (HFONT)::SelectObject(hdc, font);
im looking for something likeHFONT font=GetFont(hdc);
There must be a way to do this:mad: Pain is a weakness living the body -
Assuming that you don't want to create a font because it's expensive, what about HFONT tmp = (HFONT)SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT)); SelectObject(hdc,tmp); You don't say why you don't want to use the other methods... Steve S
-
Try
::GetCurrentObject(HDC, OBJ_FONT)
Roger Allen - Sonork 100.10016 Strong Sad: Clever I am? Next to no one. Undiscovered and soggy. Look up. Look down. They're around. Probably laughing. Still, bright, watery. Listed among the top. Ten. Nine. Late night. Early morn. Early mourn. Now I sleep.