Sign in to follow this  

windows programming

This topic is 3567 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

To create a message box in windows programming in dev c++ , we use messagebox function.. similarly how can we make a check box in windows programming. is there a function for this . thanks in advance

Share this post


Link to post
Share on other sites
There is no Checkbox() fcuntion...
You might want to check out MFC.
Usually you create your window with it's various controls using a resource
editor and then let MFC load it for you.
Also you can use CreateWindow with the appropriate class name to cerate a checkbox
(I think).

Hope this helps.

Share this post


Link to post
Share on other sites
In native Win32, you create a checkbox by specifying the BUTTON class and the BS_AUTOCHECKBOX style on a child window:

HWND checkBox = CreateWindowEx(0, L"BUTTON", L"Check me!",
BS_AUTOCHECKBOX | WS_VISIBLE | WS_CHILD, 10, 10, 100, 25,
parentWindow, (HMENU) id, NULL, NULL);

...where parentWindow is the handle of your main window and id is an integer that uniquely identifies the control. More information on using checkboxes can be found here.

Share this post


Link to post
Share on other sites
The L prefix specifies a Unicode string literal, which enables you to display extended character sets. You can disable Unicode settings in your project's configuration properties.

The id is simply an identifier for the checkbox. For example, you can check the state of a particular checkbox by passing its identifier to IsDlgButtonChecked().

Share this post


Link to post
Share on other sites

This topic is 3567 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this