Changing the font of a child-child window

Hello, im trying to specify a different font for a child window than the default one.

im proceding like this:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//creating the fonts objects
hFont = CreateFont(16, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET,
			OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
			DEFAULT_PITCH | FF_DONTCARE, TEXT("Tahoma"));
hFontBold = CreateFont(14, 0, 0, 0, FW_SEMIBOLD, FALSE, FALSE, FALSE, ANSI_CHARSET,
			OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
			DEFAULT_PITCH | FF_DONTCARE, TEXT("Tahoma"));



/////////////////////
/////////////////////

GroupBox4_2 = CreateWindow("BUTTON", "RS", WS_CHILD | WS_VISIBLE | BS_GROUPBOX, 285, 45, 626, 442, hWnd, 0, 0, 0);

//wpOldGroupBox4_2Proc = (WNDPROC)SetWindowLongPtr(GroupBox4_2, GWLP_WNDPROC, (LONG_PTR)CustomGroupBox4_2Proc);

SendMessage(GroupBox4_2, WM_SETFONT, (WPARAM)hFontBold, TRUE);


GroupBox5 = CreateWindow("BUTTON", "SS", WS_CHILD | WS_VISIBLE | BS_GROUPBOX, 560, 35, 260, 120, GroupBox4_2, 0, 0, 0);

SendMessage(GroupBox5, WM_SETFONT, (WPARAM)hFontBold, TRUE);


its working corerctly for GroupBox4_2 but not for GroupBox5.
if i declare the GroupBox5 as a child of hWnd (the main window) its working correctly.
if i dont try to declare any change for GroupBox5 the font stay as default as well. (do not take the parent font).

Can someone tell me what i am missing ?

thanks
Last edited on
Its likely something you are doing (or failing to do) in your button subclass procedure - CustomGroupBox4_2Proc. Note that the font change is taking effect for your first button, then you are setting a new subclass Window Procedure for buttons, then your call to change a font isn't working. Conclusion - its something going on in your subclass procedure (code not shown).
thanks for the reply,

however i put in comment the subclassing thing and the problem stays the same..

it seems that my issue concern only groupboxs, as i tried to create a child statictext into the same parent window and the setfont thing is working fine.

any other ideas .. ? i really have no clue on what to do at the moment
Topic archived. No new replies allowed.