I developed thing like this before
it can be done
static unsigned int idc_CehckBoxButtonStart,idc_CehckBoxButtonEnd;
switch(msg)
{
case WM_CREATE:
...
Array=GetTheArray();
idc_CehckBoxButtonStart=IDC_CHECKBOX_START_NUMBER;
idc_CehckBoxButtonEnd=idc_CehckBoxButtonStart;
for(i=0;i<arraycount;i++)>
{
CreateWindowEx(0,L"BUTTON",Array.cText,WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_RADIOBUTTON|WS_GROUP,STATIC_WIDTH+10,top,115,ALL_HEIGHT,hWnd,(HMENU)idc_CehckBoxButtonEnd,ghInstance,NULL);
idc_CehckBoxButtonEnd++;
}
break;
case WM_COMMAND:
{
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
if(wmId>=idc_CehckBoxButtonStart && wmId<idc_cehckboxbuttonend)>
{
break;
}
}