Solved

Get font info of a edit control by Win32 API function

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…

756 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