Posted: Fri Nov 14, 2008 10:25 pm Post subject: [c++] Help using checkboxes and radioboxes
I need some help using checkboxes and radioboxes in c++ iam using a resource file and i was wondering how would i start my code like ... if checkbox checked = true then being w/e how should i start out? and the case? what should i part it under example: case
Filter through WM_COMMAND, and use IsDlgButtonChecked (or send the message BM_GETCHECK explicitly.)
Code:
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_CHECKBOX:
if (IsDlgButtonChecked(hWnd, IDC_CHECKBOX))
// Checked... Add instructions.
else
// Unchecked... ADd instructions.
// You could also check for a ret of 2 (Intermediate check)
break;
}
break;
// All the other messages... ret DefWindowProc on defualt.
}
return 0;
}
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum