Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 1st, 2007, 5:22 AM   #1
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 291
Rep Power: 4 Klarre is on a distinguished road
[WIN32 API] GUI widgets font size

How do I set what font should be used in GUI controls created using the CreateWindow function?



Thanks for your help!

/Klarre
__________________
http://www.klarre.se
Klarre is offline   Reply With Quote
Old Sep 1st, 2007, 8:58 AM   #2
Eoin
Hobbyist Programmer
 
Eoin's Avatar
 
Join Date: Jun 2006
Location: Ireland
Posts: 152
Rep Power: 3 Eoin is on a distinguished road
Hi Klarre, this is not exactly an answer to your question, but if you want to use controls it's recommended to use them with a Dialog window. That way you'll not only get the correct fonts but also other things that Windows handles automatically such as being able to cycle through the controls by pressing tab.
__________________
Visit my website BinaryNotions.
Eoin is offline   Reply With Quote
Old Sep 1st, 2007, 1:14 PM   #3
Prm753
Professional Programmer
 
Prm753's Avatar
 
Join Date: Oct 2005
Location: United States
Posts: 447
Rep Power: 3 Prm753 is on a distinguished road
Send a message via AIM to Prm753 Send a message via MSN to Prm753
I've always used something like this to get my font un-nasty:

HWND hWnd = GetDlgItem( hWndButton, "BUTTON" );
HFONT hFont = GetStockObject( DEFAULT_GUI_FONT );
SendMessage( hWndButton, WM_SETFONT, (WPARAM)hFont, TRUE );

Is that what you were looking for?
__________________
The world's first athletic computer geek!
The home of PrProgramsStudios
How not to post a question: <-- Please don't reply
Prm753 is offline   Reply With Quote
Old Sep 3rd, 2007, 1:08 PM   #4
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 291
Rep Power: 4 Klarre is on a distinguished road
Thanks Prm753! Works great!

Eoin, I will check out the dialog window thing. Thanks for the tip!

/Klarre
__________________
http://www.klarre.se
Klarre is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
My first WIN32 API application ivan Show Off Your Open Source Projects 27 Jan 6th, 2006 5:04 PM
Button font size programmatically??? myName C# 3 Nov 8th, 2005 1:46 AM
colors. fonts and font size inside the table ?_? cloud- HTML / XHTML / CSS 2 Mar 12th, 2005 3:10 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:46 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC