windows programming

Started by
3 comments, last by Darklighter 16 years, 1 month ago
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
Advertisement
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.
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.
thanks..

but what is that L ...........
also what is the significance of id
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().

This topic is closed to new replies.

Advertisement