Thread: Set default font for all objects?

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    18

    Set default font for all objects?

    Hi.

    How do I set a font type for all the objects I have created?
    Instead of sending this to all objects(buttons, labels, boxes…..):
    Code:
    SendMessage(hwnd, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM(TRUE, 0));
    Can´t I joust use WM_SETFONT some other way to set the same font for all?

    For example, if I have a program with 100 buttons, I don’t want to send the same msg 100 times?
    Isn’t there a easier way to do the same thing?

    pic

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    You can use EnumChildWindows() in order to send WM_SETFONT to child that wants it.

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to set font Roman 10cpi in Crystal Reports
    By Rajesh.Prajapat in forum C# Programming
    Replies: 0
    Last Post: 10-15-2008, 12:00 AM
  2. setting default font to draw all further controls with
    By alandrums in forum Windows Programming
    Replies: 0
    Last Post: 12-03-2001, 10:31 PM
  3. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM
  4. Replies: 5
    Last Post: 09-03-2001, 09:45 PM
  5. is there a way to set a pixel or change font color?
    By Flikm in forum C++ Programming
    Replies: 9
    Last Post: 09-01-2001, 01:24 PM