tags:

views:

18

answers:

1

I've been trying to change the state of a radio button programatically:

SendMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_RADIO1, BST_CHECKED), (LPARAM)(hwnd_RADIO1));

Why won't this work?

+1  A: 

How about using BM_SETCHECK? http://msdn.microsoft.com/en-us/library/bb775989(VS.85).aspx

Matt
Ok, I tried SendMessage(m_hwnd, BM_SETCHECK, MAKEWPARAM(IDC_RADIO1, BST_CHECKED), (LPARAM)(hwnd_RADIO1)) but i want it to execute the code at case IDC_RADIO1: when i check the button programatically.
Vic