adding font to a combo box

This is a discussion on adding font to a combo box within the Windows Programming forums, part of the Platform Specific Boards category; I have created a list box using this code... Code: hFontTypeButton = CreateWindowEx( 0, WC_COMBOBOXEX, NULL, CBS_SIMPLE | WS_CHILD | ...

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    8

    adding font to a combo box

    I have created a list box using this code...



    Code:
    hFontTypeButton = CreateWindowEx( 0, WC_COMBOBOXEX,      
    				NULL,
    				CBS_SIMPLE | WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST,
    				55,2,170,23,hDnaToolBar,
    				(HMENU)IDB_FONTTYPE,
    				(HINSTANCE)GetWindowLong( hDnaToolBar, GWL_HINSTANCE ),
    				NULL);
    I can see the listbox or combobox (whatever it's called) in my window and I want to add all the fonts on my system (the ones in the C:\Windows\Fonts folder) but I have no idea how to do this. Can anyone help me? Thanks.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Perhaps this will help?
    http://bcbjournal.org/articles/vol2/...9ca3053c3dd229

    It may not be EXACTLY what you want (or rather, because it's C++ builder, it may do it in a slightly different way than you would add things to the combo box), but the basic principle of finding the fonts, etc, I think is the same.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. adding font to a list box or combo box
    By supernater in forum Windows Programming
    Replies: 2
    Last Post: 03-13-2009, 06:53 AM
  2. Create new combo boxes based on items selected in preview combo box
    By RealityFusion in forum Windows Programming
    Replies: 2
    Last Post: 01-10-2007, 09:50 AM
  3. problem with my font manager
    By hannibar in forum C Programming
    Replies: 1
    Last Post: 03-07-2006, 08:03 AM
  4. No data showing in combo box
    By PJYelton in forum Windows Programming
    Replies: 6
    Last Post: 04-29-2005, 08:20 PM
  5. New Theme
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 04-01-2004, 08:00 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21