Solved

Get font info of a edit control by Win32 API function

Posted on 2006-11-10
4
889 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
List out all word 7 353
Fibonacci challenge 11 141
noX challenge 17 144
I could not set window to top 4 62
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
In this post we will learn different types of Android Layout and some basics of an Android App.
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…

737 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