Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

cpp boy

Windows programming

This topic is 5244 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to know how to do whats listed : - Draw a commande button or any type of button like a Check box, Drive list box ect... - How to use them properly. Is there any variable, class or function that I can manipulate. You can give me this here on the forum or by form of tutorial. I would preferly like to have this not on a dialog box or an mfc application. Kevin

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Do you know how to ask politely?

Do you expect this information at no cost?

Do you know there are people who charge money for giving away such information?

Do you know how to read a book?

Do you know how to search the Internet using Google?

Do you know that I hope that no one answers you. Now you know.

Share this post


Link to post
Share on other sites
Anonymous Posters should just not be allowed to post.

quote:
Do you expect this information at no cost?

Do you know there are people who charge money for giving away such information?



What are you smoking?

Share this post


Link to post
Share on other sites
Ok, i will give you this information "for no cost" , but i''ll confess you that english isnt my languaje so maybe i couald have some mistakes.

To create a button you need the function CreateWindow.

Like this:

First :
HWND myboton;
In the WM_CREATE message:
myboton=CreateWindow("button","th_text", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 100, 100, 100, 100, hwnd, NULL, hinst, NULL);

Just pass "button" to the class type and in the flags you use WS_CHILD and WS_VISIBLE

You can also create listboxes, rich edits, etc with this function.


Thats it.

OHH!! i was forgetting:

In the WM_COMMAND message oyu check if the button is pressed.

case WM_COMMAND:
if((HWND)lparam==myboton)
{
Here goes the actions after the button is pressed
}



Thats all.

And it really is free. FREE!!!!! FREEE!!!!!

Share this post


Link to post
Share on other sites
Tank you very much. I was waiting for this for a long while. And people I do agree that anonymous poster shouldn''t be alowed here or we should have a special tag that allows us to let them answer or not. But that just my two cents

Kevin

Share this post


Link to post
Share on other sites
Remember that in Windows, everything is a Window, including the buttons, checkboxes, and anything else you see. So all you need to do is call CreateWindow with the correct parameters, and a call back function.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!