BOOL CDisplayConfigDlg::OnInitDialog() {
    BOOL bRet = CDialog::OnInitDialog();

    m_cmbTypes.AddString(_T("录制全屏"));
    m_cmbTypes.AddString(_T("录制窗口"));
    m_cmbTypes.AddString(_T("录制指定区域"));

    m_cmbTypes.SetCurSel(m_pInfo->type);

    OnCbnSelchangeComboType();
    return bRet;
}
void CConfigZoneDlg::OnLbnSelchangeList1()
{
	int ndx = m_list.GetCurSel(); if (ndx < 0)return;
	int zone_value = m_list.GetItemData(ndx);
	if (0 < zone_value && zone_value < 8) {
		EnableWindows(0);
		return;
	}

	if (g_zoneInfo[zone_value].type == ZT_NULL) { // 未对码
		EnableGroupDuima();
		EnableGroupChangeProperty(0);
		m_btnDeleteZone.EnableWindow(0);
		m_chkDuimaByEmmitDetector.SetCheck(1);
		OnBnClickedCheck1();
		m_staticDuimaOrChange.SetWindowTextW(L"对码");
		m_staticManual.SetWindowTextW(L"手动写入无线地址对码");
		m_btnDuima.SetWindowTextW(L"对码");
	} else if (g_zoneInfo[zone_value].type == ZT_ZONE) { // 直属防区
		EnableGroupDuima(0);
		EnableGroupChangeProperty(0);
		m_btnDeleteZone.EnableWindow();
		CString addr;
		addr.Format(L"%04X", g_zoneInfo[zone_value].addr);
		m_addr.SetWindowTextW(addr);
		m_chkDuimaByEmmitDetector.SetCheck(0);
		OnBnClickedCheck1();
		m_chkDuimaByEmmitDetector.EnableWindow(0);
		m_cmbType.SetCurSel(0);
		OnCbnSelchangeComboType();

		switch (g_zoneInfo[zone_value].status_or_property) {
		
		case ZP_GLOBAL:
		case ZP_HALF:
		case ZP_EMERGE:
		case ZP_SHIELD:
		case ZP_DOOR:
			for (int i = 0; i < m_cmbBurglarZoneProperty.GetCount(); i++) {
				auto data = m_cmbBurglarZoneProperty.GetItemData(i);
				if (data == g_zoneInfo[zone_value].status_or_property) {
					m_cmbBurglarZoneProperty.SetCurSel(i);
					break;
				}
			}
			break;
		case ZP_FIRE:
		case ZP_DURESS:
		case ZP_GAS:
		case ZP_WATER:
			for (int i = 0; i < m_cmbProperty.GetCount(); i++) {
				auto data = m_cmbProperty.GetItemData(i);
				if (data == g_zoneInfo[zone_value].status_or_property) {
					m_cmbProperty.SetCurSel(i);
					break;
				}
			}
			break;
		case ZSOP_INVALID:
		case ZS_ARM:
		case ZS_DISARM:
		default:
			assert(0);
			break;
		}
		m_staticDuimaOrChange.SetWindowTextW(L"修改");
		m_staticManual.SetWindowTextW(L"");
		m_btnDuima.SetWindowTextW(L"修改");
	} else if (g_zoneInfo[zone_value].type == ZT_SUBMACHINE) { // 分机防区
		EnableGroupDuima(0);
		EnableGroupChangeProperty(0);
		m_btnDeleteZone.EnableWindow();
		CString addr;
		addr.Format(L"%04X", g_zoneInfo[zone_value].addr);
		m_addr.SetWindowTextW(addr);
		m_chkDuimaByEmmitDetector.SetCheck(0);
		OnBnClickedCheck1();
		m_chkDuimaByEmmitDetector.EnableWindow(0);
		m_cmbType.SetCurSel(1);
		OnCbnSelchangeComboType();

		m_staticDuimaOrChange.SetWindowTextW(L"修改");
		m_staticManual.SetWindowTextW(L"");
		m_btnDuima.SetWindowTextW(L"修改");
	} else { assert(0); }
}