On the other hand, in the event that some other nitwit comes along and does not KNOW they have to be in order, you can declare a static array of UINT in your source file containing the identifiers, and use that as the basis for your looping. static UINT s_ControlArray[] = { IDC_CONTROL_1_1, IDC_CONTROL_1_2, IDC_CONTROL_1_3, IDC_CONTROL_2_1, IDC_CONTROL_2_2, IDC_CONTROL_2_3 }; Use a for loop to access the elements in the array. The GetDlgItem() would work using those identifier values, and then you can use the EnableItem as you wanted.