Link to home
Start Free TrialLog in
Avatar of IdanM
IdanM

asked on

Create a Button using CreateWindow

Hi,

I am trying to create a button on a window using the CreateWindow function and the class "Button". However, the button being created is different in looks than buttons I create using Dialog Boxes resources. It has a different font and perhaps other different details that I can't make for sure. Am I missing some style flag? I found no help on that issue in the SDK Documentation. I wish to make the button I create on the window to look like my dialog boxes buttons.
Here is the CreateWindow code:

m_hPlayButton = CreateWindow("Button", "&Play", WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 5, 5, 100, 100, m_hPlayWindow, NULL, (HINSTANCE)GetWindowLong(m_hPlayWindow, GWL_HINSTANCE), NULL);

Thanks,
Idan.
Avatar of PlanetCpp
PlanetCpp

did you specify a different font when you used dialogs? i don't use dialogs but i think they should look exactlly the same.
you can look at the source on my site www.PlanetCpp.com.
most source has a button on it for you to look at and one has the ability to change fonts.
Avatar of IdanM

ASKER

I just used the resource editor to edit a Dialog Boxes. Some of your buttons in your site look the same as mine, with a different font.
ASKER CERTIFIED SOLUTION
Avatar of TascoDLX
TascoDLX

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the buttons on my site look the same as the ones you're having a problem with? thats the way buttons look, unless you specify to make them checkbox style. what is the difference that used to be in the dialog buttons, they should be the same
Avatar of IdanM

ASKER

Thanks, that did the trick :)