EnableWindow(GetDlgItem(IDC_BG0), enable[0]); EnableWindow(GetDlgItem(IDC_BG1), enable[1]); EnableWindow(GetDlgItem(IDC_BG2), enable[2]); EnableWindow(GetDlgItem(IDC_BG3), enable[3]); EnableWindow(GetDlgItem(IDC_FRAME_0), enable[4]); EnableWindow(GetDlgItem(IDC_FRAME_1), enable[5]);
GetDlgItem(IDC_BG0)->EnableWindow(enable[0]); GetDlgItem(IDC_BG1)->EnableWindow(enable[1]); GetDlgItem(IDC_BG2)->EnableWindow(enable[2]); GetDlgItem(IDC_BG3)->EnableWindow(enable[3]); GetDlgItem(IDC_FRAME_0)->EnableWindow(enable[4]); GetDlgItem(IDC_FRAME_1)->EnableWindow(enable[5]);
void MapView::enableButtons(int mode){  bool enable[6] = { true, true, true, true, true, true };  switch(mode) {  case 0:    enable[4] = false;    enable[5] = false;    break;  case 1:    enable[3] = false;    enable[4] = false;    enable[5] = false;    break;  case 2:    enable[0] = false;    enable[1] = false;    enable[4] = false;    enable[5] = false;    break;  case 3:    enable[0] = false;    enable[1] = false;    enable[2] = false;    enable[3] = false;    enable[4] = false;    enable[5] = false;    break;  case 4:    enable[0] = false;    enable[1] = false;    enable[2] = false;    enable[3] = false;    break;      case 5:    enable[0] = false;    enable[1] = false;    enable[2] = false;    enable[3] = false;    break;      }  EnableWindow(GetDlgItem(IDC_BG0), enable[0]);  EnableWindow(GetDlgItem(IDC_BG1), enable[1]);  EnableWindow(GetDlgItem(IDC_BG2), enable[2]);  EnableWindow(GetDlgItem(IDC_BG3), enable[3]);  EnableWindow(GetDlgItem(IDC_FRAME_0), enable[4]);  EnableWindow(GetDlgItem(IDC_FRAME_1), enable[5]);  int id = IDC_BG0;  switch(bg) {  case 1:    id = IDC_BG1;    break;  case 2:    id = IDC_BG2;    break;  case 3:    id = IDC_BG3;    break;  }  SendMessage(GetDlgItem(id), BM_SETCHECK, BST_CHECKED, 0);  id = IDC_FRAME_0;  if(frame != 0)    id = IDC_FRAME_1;  SendMessage(GetDlgItem(id), BM_SETCHECK, BST_CHECKED, 0);}