Board index » cppbuilder » CreateWindowEx

CreateWindowEx


2007-06-30 01:32:56 AM
cppbuilder28
I've added a button to a dialog using CreateWindowEx and
everything works as intended except that the caption is
bold text. How do I get rid of the bold?
HWND hLayout = ::CreateWindowEx( ::GetWindowLong(hOK, GWL_EXSTYLE), //
copy the IDOK button
"BUTTON", "Layout",
::GetWindowLong(hOK, GWL_STYLE) &
~BS_DEFPUSHBUTTON,
R.left, R.top, R.right - R.left,
R.bottom - R.top,
hDlg, (HMENU)IDLAYOUT, HInstance,
NULL );
~ JD
 
 

Re:CreateWindowEx

"JD" < XXXX@XXXXX.COM >wrote in message
Quote
I've added a button to a dialog using CreateWindowEx
and everything works as intended except that the caption
is bold text. How do I get rid of the bold?
You are not setting a font to the window, so a default font is being
used. Look at the WM_SETFONT message.
Gambit
 

Re:CreateWindowEx

"Remy Lebeau \(TeamB\)" < XXXX@XXXXX.COM >wrote:
Quote

[...] Look at the WM_SETFONT message.
Thanks. It's all working as desired now but I have a couple of
questions:
Is this ok to do?
::SendMessage( hMargins,
WM_SETFONT,
(WPARAM)::SendMessage(hOK, WM_GETFONT, NULL, NULL),
TRUE );
Do I need to explicitly destroy the button created using
CreateWindowEx (I set it's parent as the dialog)? IOW,
does it work the same as the VCL?
~ JD
 

{smallsort}

Re:CreateWindowEx

"JD" < XXXX@XXXXX.COM >wrote in message
Quote
Is this ok to do?
Yes.
Quote
Do I need to explicitly destroy the button created using
CreateWindowEx (I set it's parent as the dialog)?
No.
Gambit
 

Re:CreateWindowEx

Thank you!
~ JD