CreateWindow/Ex function creates object in different fonts

Hi

I have an application that consists of about 15/20 buttons on about 20/30 forms. Depending upon the user's
rights and current and last activity performed, about 4-5 of them are active.

I recently derived a class to handle the common activities, Instead of creating 30 forms with the same
button map below, I decided to use CreateWindow function and creates button at runtime.
Positioning of button worked out very fine simply by use of bounding static control and computing
each size from it.

Problem is that button fonts are always Bold. While I know the WM_PAINT and Windows DC
functions, I do want to write separate Windowproc to redraw buttons (effectively re-inventing wheel)

I also tried CreateWindowEx but with no luck

Any suggestions
LVL 2
SamratAshokAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
raybConnect With a Mentor Commented:
If you are indeed using MFC then you can call the CWnd::SetFont which through inheritance is also a member of CButton.


0
 
raybCommented:
If you are not using MFC, you can try something similar to this:

::SendMessage(m_hWnd, WM_SETFONT, (WPARAM)pFont->GetSafeHandle(), bRedraw);
0
All Courses

From novice to tech pro — start learning today.