Click here to Skip to main content
15,882,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello readers. I am learning Windows programming and I created a button in my application using the following function :
CreateWindow("BUTTON", "OK", WS_CHILD | WS_VISIBLE, hwnd, 10, 10, 100, 50, NULL, NULL, NULL, NULL);
But this function creates a rectangular button like this.Picture of dialog box in c++
This is a square button. I want to create a button like this.A simple Windows message box
Here in the second image, the buttons are in rounded rectangle shape. This is what I want to create. Please provide a suitable answer to me. Thank you for reading.

What I have tried:

I searched on youtube and google but they showed how to create the buttons mentioned in the above first image.
Posted
Updated 14-Aug-20 8:45am
v2
Comments
Shao Voon Wong 14-Aug-20 23:58pm    
I believe the default button style depends on the OSes. The first picture is button style on Win8/10 while the 2nd picture is button style on Vista/Win7.

1 solution

 
Share this answer
 
Comments
VD-Flash 14-Aug-20 14:48pm    
Sorry, Sandeep but this does not solve my problem.
Rick York 14-Aug-20 15:33pm    
Why not? If you do not tell us why how you can you expect us to solve it for you?
VD-Flash 14-Aug-20 15:43pm    
I have already mentioned the problem. Above in the question's description, I have given the links of two pictures. The first one shows the buttons that I end up making. The second picture shows the buttons that I want to create but I don't know the appropriate code for it. And by buttons, I mean the yes/no or the ok/cancel buttons in the dialog boxes.
[no name] 14-Aug-20 16:14pm    
Don't blame the one who try to help when _you_ are not able to implement the things suggested on the links!
VD-Flash 14-Aug-20 21:48pm    
I am *certainly* not blaming anyone. And I am really sorry if my words sound disapproving. I will try to make them more polite. As of now can you guys please provide me a suitable solution?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900