Solved

Get font info of a edit control by Win32 API function

Posted on 2006-11-10
4
901 Views
Last Modified: 2013-12-03
Pls show me how to Get font info of a edit control by Win32 API function ?

Thanks.
0
Comment
Question by:Harry_Kewell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 17917091
If you have a pointer to the edit control, call 'GetFont()', e.g.

CEdit* pEdit = ...;

CFont* pFont = pEdit->GetFont();
0
 

Author Comment

by:Harry_Kewell
ID: 17919862
Could we do that in Win32 API (not MFC) ?
0
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 17919868
Well, this is the MFC area... ;o)

But, using Win32, that would be

HFONT hFont = (HFONT) SendMessage(hEditCtrl,WM_GETFONT,0,0);

As the docs state:

WM_GETFONT
An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text.

WM_GETFONT
wParam = 0; // not used, must be zero
lParam = 0; // not used, must be zero
 
Parameters
This message has no parameters.

Return Values
The return value is a handle to the font used by the control, or NULL if the control is using the system font.

0
 

Author Comment

by:Harry_Kewell
ID: 17924513
Thks jkr. Hope more help from you.
0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question