How to create checkbox or checkboxes using Win32 API's? I don't want to drag and drop check box. I want to create checkbox in WM_CREATE. Is there any way to do it?
In the arguments to CreateWindowEx(), the class name should be BUTTON, and the window style should be BS_CHECKBOX. Both are built-in constants defined in Windows.h
hWnd = CreateWindowEx(NULL,BUTTON,"Checkbox",BS_CHECKBOX,xPos,yPos,width,height,parent,NULL,NULL,NULL)
You would handle it's messages just as you would those from any other window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With