I created (at runtime) a Tab Control, but it has an ugly "System" font on tabs. When I send to the control a WM_SETFONT message with NULL parameter, nothing changes. When I make a
calling to retrieve default font, I get the same "System" font. I use w2k, so there should be "Tahoma" (as you can read in MSDN) instead of "System". I tried to run the program on another computer with w98, but with the same result. How is it that GetStockObject simply doesn't work? I'd like my program to be adaptable.
To get the font used by dialog box controls use GetStockObject(DEFAULT_GUI_FONT). To change the font using WM_SETFONT to one you have defined you need to create the font using either CreateFont or CreateFontIndirect. Remember to DeleteObject on any such HFONT when you are done with it, although you don't need to do so with those gdi objects returned from GetStockObject (nor is it harmful to do so).
Hope that helps. :)
DEFAULT_GUI_FONT returns Sans Serif, but it's not the font used by dialog box controls - as far as I can see, dialog box controls use Tahoma. Buttons, edit boxes, combo boxes, etc... I think this doesn't solve the problem.
Maybe I really have to use SYSTEM_FONT parameter as says MSDN. But there must be something wrong with GetStockObject function, because it doesn't return what it should with this parameter.