void CDialogProperty::LoadProperties(bool reload /*= true*/)
{
	m_properties.ResetContent();

	if (reload)
	{
		m_dup_prop_map = m_parent->get_config_prop().get_val();
	}

	for (prop_kv_config::t_map::const_iterator iter = m_dup_prop_map.first(); iter.is_valid(); ++iter)
	{
		pfc::stringcvt::string_wide_from_utf8_fast wname = iter->m_key;
		HPROPERTY hProp = NULL;
		const _variant_t & v = iter->m_value;
		_variant_t var;

		switch (v.vt)
		{
		case VT_BOOL:
			hProp = PropCreateSimple(wname, v.boolVal ? true : false);
			break;

		case VT_I1:
		case VT_UI1:
		case VT_I2:
		case VT_UI2:
		case VT_I4:
		case VT_UI4:
		case VT_I8:
		case VT_UI8:
			var.ChangeType(VT_I4, &v);
			hProp = PropCreateSimple(wname, var.lVal);
			break;

		case VT_BSTR:
		default:
			var.ChangeType(VT_BSTR, &v);
			hProp = PropCreateSimple(wname, var.bstrVal);
			break;
		}

		m_properties.AddItem(hProp);
	}
}
LRESULT CServerParamsDlg::OnBrowseServerFolders(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) {

	
	CString login = GuiTools::GetDlgItemText(m_hWnd, IDC_LOGINEDIT);
	serverProfile_.setProfileName(login);
	ServerSettingsStruct& serverSettings = serverProfile_.serverSettings();
	
	CString password = GuiTools::GetDlgItemText(m_hWnd, IDC_PASSWORDEDIT);
	serverSettings.authData.Login = WCstringToUtf8(login);
	serverSettings.authData.Password = WCstringToUtf8(password);
	serverSettings.authData.DoAuth = GuiTools::GetCheck(m_hWnd, IDC_DOAUTH);
	CServerFolderSelect folderSelectDlg(serverProfile_);
	folderSelectDlg.m_SelectedFolder.id = serverProfile_.folderId();

	if ( folderSelectDlg.DoModal() == IDOK ) {
		CFolderItem folder = folderSelectDlg.m_SelectedFolder;
	

		if(!folder.id.empty()){
			serverProfile_.setFolderId(folder.getId());
			serverProfile_.setFolderTitle(folder.getTitle());
			serverProfile_.setFolderUrl(folder.viewUrl);
		} else {
			serverProfile_.setFolderId("");
			serverProfile_.setFolderTitle("");
			serverProfile_.setFolderUrl("");
		}

		SetDlgItemText(IDC_FOLDERNAMELABEL, Utf8ToWCstring( folder.getTitle() ));


	};
	if(!m_pluginLoader)
	{
		return 0;
	}
	m_wndParamList.ResetContent();
	m_pluginLoader->getServerParamList(m_paramNameList);
	
	std::map<std::string,std::string>::iterator it;
	for( it = m_paramNameList.begin(); it!= m_paramNameList.end(); ++it)
	{
		CString name = it->first.c_str();
		CString humanName = it->second.c_str();
		m_wndParamList.AddItem( PropCreateSimple(humanName, Utf8ToWCstring(serverSettings.params[WCstringToUtf8(name)])) );
	}

	return 0;
}
Esempio n. 3
0
void CMiscPage::OnPageDisplay( void )
{
  HPROPERTY hItem;
  m_PropertyList.AddItem( PropCreateCategory("Strings") );
  for (int i = 0; i < PREF_STRING_MAX; i++)
  {
    hItem = m_PropertyList.AddItem( PropCreateSimple(PREF_STRING_NAME(i) , g_pNewPrefs->m_StringPrefs[i] ));
    if (hItem)
      m_PropertyList.SetItemData(hItem, MAKELPARAM(i,PII_STRING) );
  }
  m_PropertyList.AddItem( PropCreateCategory("Paths") );
  for (int i = 0; i < PREF_PATH_MAX; i++)
  {
    hItem = m_PropertyList.AddItem( PropCreateFileName(PREF_PATH_NAME(i) , g_pNewPrefs->m_PathPrefs[i] ));
    if (hItem)
      m_PropertyList.SetItemData(hItem, MAKELPARAM(i,PII_PATH) );
  }
  m_PropertyList.AddItem( PropCreateCategory("Numbers") );
  for (int i = 0; i < PREF_INT_MAX; i++)
  {
    hItem = m_PropertyList.AddItem( PropCreateSimple(PREF_INT_NAME(i) , (LONG)g_pNewPrefs->m_IntPrefs[i] ));
    if (hItem)
      m_PropertyList.SetItemData(hItem, MAKELPARAM(i,PII_INTEGER) );
  }
  m_PropertyList.AddItem( PropCreateCategory("Booleans") );
  for (int i = 0; i < PREF_BOOL_MAX; i++)
  {
    hItem = m_PropertyList.AddItem( PropCreateSimple(PREF_BOOL_NAME(i) , g_pNewPrefs->m_BoolPrefs[i] ? (bool)true : (bool)false )); // note the case of "bool"
    if (hItem)
      m_PropertyList.SetItemData(hItem, MAKELPARAM(i,PII_BOOL) );
  }
  m_PropertyList.AddItem( PropCreateCategory("Fonts") );
  for (int i = 0; i < PREF_FONT_MAX; i++)
  {
    char *FontInfo = HydraIRC_BuildString(128,"%s,%d,%s%s%s",
      g_pNewPrefs->m_FontPrefs[i].m_Name,
      g_pNewPrefs->m_FontPrefs[i].m_Size,
      g_pNewPrefs->m_FontPrefs[i].m_Flags == FIF_NONE ? "N" : 
        (g_pNewPrefs->m_FontPrefs[i].m_Flags & FIF_BOLD ? "B" : ""),
      g_pNewPrefs->m_FontPrefs[i].m_Flags & FIF_ITALIC ? "I" : "",
      g_pNewPrefs->m_FontPrefs[i].m_Flags & FIF_UNDERLINE ? "U" : "");

    if (FontInfo)
    {
      hItem = m_PropertyList.AddItem( PropCreateSimple(PREF_FONT_NAME(i), FontInfo ));
      if (hItem)
        m_PropertyList.SetItemData(hItem, MAKELPARAM(i,PII_FONT) );
      free(FontInfo);
    }
  }
  m_PropertyList.AddItem( PropCreateCategory("Colors") );
  for (int i = 0; i < PREF_COLOR_MAX; i++)
  {
    char *ColorInfo;

    if (g_pNewPrefs->m_ColorPrefs[i] != -1)
      ColorInfo = HydraIRC_BuildString(8,"#%06x",RGBVALTOCOLORREF(g_pNewPrefs->m_ColorPrefs[i]));
    else
      ColorInfo = strdup("System");

    if (ColorInfo)
    {
      hItem = m_PropertyList.AddItem( PropCreateSimple(PREF_COLOR_NAME(i) , ColorInfo ));
      if (hItem)
        m_PropertyList.SetItemData(hItem, MAKELPARAM(i,PII_COLOR) );
      free(ColorInfo);
    }
  }


  this->UpdateWindow();
}
Esempio n. 4
0
LRESULT 
CHardwarePage::OnInitDialog(HWND hwndFocus, LPARAM lParam)
{
	ATLASSERT(NULL != m_pDevice);

	if (NULL == m_pDevice) {
		return 0;
	}

	m_propList.SubclassWindow(GetDlgItem(IDC_PROPLIST));
	m_propList.SetExtendedListStyle(PLS_EX_CATEGORIZED);

	CString strType, strValue;

	//
	// Device Hardware Information
	//
	const NDAS_DEVICE_HW_INFORMATION* pDevHWInfo = m_pDevice->GetHwInfo();

	strValue.LoadString(IDS_DEVPROP_CATEGORY_HARDWARE);
	m_propList.AddItem(PropCreateCategory(strValue));

	if (NULL == pDevHWInfo) {
		m_propList.AddItem(PropCreateSimple(_T("Not available."), _T("")));
		return 0;
	}

	// Version
	strType.LoadString(IDS_DEVPROP_HW_VERSION);
	pHWVersionString(strValue, pDevHWInfo->dwHwVersion);
	m_propList.AddItem(PropCreateSimple(strType, strValue));

	// Max Request Blocks
	strType.LoadString(IDS_DEVPROP_HW_MAX_REQUEST_BLOCKS);
	strValue.Format(_T("%d"), pDevHWInfo->nMaxRequestBlocks);
	m_propList.AddItem(PropCreateSimple(strType, strValue));

	// Slots
	strType.LoadString(IDS_DEVPROP_HW_SLOT_COUNT);
	strValue.Format(_T("%d"), pDevHWInfo->nSlots);
	m_propList.AddItem(PropCreateSimple(strType, strValue));

	// Targets
	strType.LoadString(IDS_DEVPROP_HW_TARGET_COUNT);
	strValue.Format(_T("%d"), pDevHWInfo->nTargets);
	m_propList.AddItem(PropCreateSimple(strType, strValue));

	// Max Targets
	strType.LoadString(IDS_DEVPROP_HW_MAX_TARGET_COUNT);
	strValue.Format(_T("%d"), pDevHWInfo->nMaxTargets);
	m_propList.AddItem(PropCreateSimple(strType, strValue));

	// Max LUs
	strType.LoadString(IDS_DEVPROP_HW_MAX_LU_COUNT);
	strValue.Format(_T("%d"), pDevHWInfo->nMaxLUs);
	m_propList.AddItem(PropCreateSimple(strType, strValue));

	//
	// Unit Device Hardware Information
	//

	for (DWORD i = 0; i < m_pDevice->GetUnitDeviceCount(); ++i) {

		ndas::UnitDevice* pUnitDevice = m_pDevice->GetUnitDevice(i);

		const NDAS_UNITDEVICE_HW_INFORMATION* pHWI = pUnitDevice->GetHWInfo();

		strValue.FormatMessage(IDS_DEVPROP_UNITDEV_TITLE_FMT, i + 1);

		m_propList.AddItem(PropCreateCategory(strValue));

		if (NULL == pHWI) {
			m_propList.AddItem(PropCreateSimple(_T("Not available"), _T("")));
			continue;
		}

		// Media Type
		strType.LoadString(IDS_DEVPROP_UNITDEV_DEVICE_TYPE);
		pUnitDeviceMediaTypeString(strValue, pHWI->MediaType);
		m_propList.AddItem(PropCreateSimple(strType, strValue));

		// Transfer Mode
		strType.LoadString(IDS_DEVPROP_UNITDEV_TRANSFER_MODE);
		strValue = _T("");

		if (pHWI->bPIO) strValue += _T("PIO, ");
		if (pHWI->bDMA) strValue += _T("DMA, ");
		if (pHWI->bUDMA) strValue += _T("UDMA, ");
		if (strValue.GetLength() > 2) {
			// Trimming ", "
			strValue = strValue.Left(strValue.GetLength() - 2);
		}
		m_propList.AddItem(PropCreateSimple(strType, strValue));

		// LBA support?
		strType.LoadString(IDS_DEVPROP_UNITDEV_LBA_MODE);
		strValue = _T("");
		if (pHWI->bLBA) strValue += _T("LBA, ");
		if (pHWI->bLBA48) strValue += _T("LBA48, ");
		if (strValue.GetLength() > 2) {
			// Trimming ", "
			strValue = strValue.Left(strValue.GetLength() - 2);
		}
		m_propList.AddItem(PropCreateSimple(strType, strValue));

		// Model
		strType.LoadString(IDS_DEVPROP_UNITDEV_MODEL);
		strValue = pHWI->szModel;
		strValue.TrimRight(); 
		m_propList.AddItem(PropCreateSimple(strType, strValue));

		// FWRev
		strType.LoadString(IDS_DEVPROP_UNITDEV_FWREV);
		strValue = pHWI->szFwRev;
		strValue.TrimRight(); 
		m_propList.AddItem(PropCreateSimple(strType, strValue));

		// Serial No
		strType.LoadString(IDS_DEVPROP_UNITDEV_SERIALNO);
		strValue = pHWI->szSerialNo;
		strValue.TrimRight(); 
		m_propList.AddItem(PropCreateSimple(strType, strValue));

		pUnitDevice->Release();
	}

	return 0;
}
LRESULT CServerParamsDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	CenterWindow(GetParent());
	TRC(IDCANCEL, "Отмена");
	TRC(IDOK, "OK");
	TRC(IDC_LOGINLABEL, "Логин:");
	TRC(IDC_PASSWORDLABEL, "Пароль:");
	TRC(IDC_DOAUTH, "Выполнять авторизацию");
	TRC(IDC_FOLDERLABEL, "Папка/альбом:");
	TRC(IDC_BROWSESERVERFOLDERS, "Выбрать...");
	TRC(IDC_PARAMETERSLABEL, "Параметры:");
	DlgResize_Init();
	CString WindowTitle;
	CString serverName = Utf8ToWCstring(m_ue->Name);
	WindowTitle.Format(TR("Параметры сервера %s"),(LPCTSTR)serverName);
	SetWindowText(WindowTitle);
	GuiTools::ShowDialogItem(m_hWnd, IDC_BROWSESERVERFOLDERS, m_ue->SupportsFolders);
	GuiTools::ShowDialogItem(m_hWnd, IDC_FOLDERLABEL, m_ue->SupportsFolders);
	GuiTools::ShowDialogItem(m_hWnd, IDC_FOLDERNAMELABEL, m_ue->SupportsFolders);
	::EnableWindow(GetDlgItem(IDC_BROWSESERVERFOLDERS), m_ue->SupportsFolders);
	GuiTools::ShowDialogItem(m_hWnd, IDC_DOAUTH, m_ue->NeedAuthorization == CUploadEngineData::naAvailable );

	GuiTools::ShowDialogItem(m_hWnd, IDC_FOLDERLABEL, m_ue->SupportsFolders );
	GuiTools::ShowDialogItem(m_hWnd, IDC_FOLDERNAMELABEL, m_ue->SupportsFolders );
	GuiTools::ShowDialogItem(m_hWnd, IDC_BROWSESERVERFOLDERS, m_ue->SupportsFolders );
	GuiTools::ShowDialogItem(m_hWnd, IDC_FOLDERICON, m_ue->SupportsFolders );

	
	ServerSettingsStruct &serverSettings = serverProfile_.serverSettings();
	LoginInfo li = serverSettings.authData;
	SetDlgItemText(IDC_LOGINEDIT, Utf8ToWCstring(li.Login));
	oldLogin_ =  Utf8ToWCstring(li.Login);
	SetDlgItemText(IDC_PASSWORDEDIT, Utf8ToWCstring(li.Password));


	SendDlgItemMessage(IDC_DOAUTH, BM_SETCHECK, (li.DoAuth ? BST_CHECKED : BST_UNCHECKED));
	doAuthChanged();
	int result = 1;
	if ( focusOnLoginControl_ && m_ue->NeedAuthorization ) {
		GuiTools::SetCheck(m_hWnd, IDC_DOAUTH, true);
		doAuthChanged();
		::SetFocus(GetDlgItem(IDC_LOGINEDIT) );
		SendDlgItemMessage(IDC_LOGINEDIT, EM_SETSEL, 0, -1);
		result = 0;
	}

	GuiTools::EnableDialogItem(m_hWnd, IDC_BROWSESERVERFOLDERS, !oldLogin_.IsEmpty());

	


	m_wndParamList.SubclassWindow(GetDlgItem(IDC_PARAMLIST));
	m_wndParamList.SetExtendedListStyle(PLS_EX_SHOWSELALWAYS | PLS_EX_SINGLECLICKEDIT);

	m_pluginLoader = iuPluginManager.getPlugin(m_ue->Name, m_ue->PluginName,serverSettings);
	if(!m_pluginLoader)
	{
		return 0;
	}
	m_pluginLoader->getServerParamList(m_paramNameList);

	std::map<std::string,std::string>::iterator it;
	for( it = m_paramNameList.begin(); it!= m_paramNameList.end(); ++it)
	{
		CString name = it->first.c_str();
		CString humanName = it->second.c_str();
		m_wndParamList.AddItem( PropCreateSimple(humanName, Utf8ToWCstring(serverSettings.params[WCstringToUtf8(name)])) );
	}
	CString folderTitle = Utf8ToWCstring( serverProfile_.folderTitle()) ;

	SetDlgItemText(IDC_FOLDERNAMELABEL, folderTitle.IsEmpty() ? (CString("<") + TR("не выбран") + CString(">")) : folderTitle);

	return 1;  // Let the system set the focus
}
Esempio n. 6
0
LRESULT 
CDeviceHardwarePage::OnInitDialog(HWND hwndFocus, LPARAM lParam)
{
	ATLASSERT(NULL != m_pDevice.get());
	if (NULL == m_pDevice.get()) 
	{
		return 0;
	}

	m_propList.SubclassWindow(GetDlgItem(IDC_PROPLIST));
	m_propList.SetExtendedListStyle(PLS_EX_CATEGORIZED);


	//
	// Device Hardware Information
	//
	boost::shared_ptr<const NDAS_DEVICE_HARDWARE_INFO> pDevHWInfo = m_pDevice->GetHardwareInfo();

	CString strValue = (LPCTSTR) IDS_DEVPROP_CATEGORY_HARDWARE;
	m_propList.AddItem(PropCreateCategory(strValue));

	if (0 == pDevHWInfo.get()) 
	{
		CString str = MAKEINTRESOURCE(IDS_DEVICE_HARDWARE_INFO_NA);
		m_propList.AddItem(PropCreateSimple(str, _T("")));
		return 0;
	}

	CString strType;

	// Version
	strType.LoadString(IDS_DEVPROP_HW_VERSION);
	pHWVersionString(strValue, pDevHWInfo->HardwareVersion);
	m_propList.AddItem(PropCreateSimple(strType, strValue));

	// Max Request Blocks
	strType.LoadString(IDS_DEVPROP_HW_MAX_REQUEST_BLOCKS);
	strValue.Format(_T("%d"), pDevHWInfo->MaximumTransferBlocks);
	m_propList.AddItem(PropCreateSimple(strType, strValue));

	// Slots
	strType.LoadString(IDS_DEVPROP_HW_SLOT_COUNT);
	strValue.Format(_T("%d"), pDevHWInfo->NumberOfCommandProcessingSlots);
	m_propList.AddItem(PropCreateSimple(strType, strValue));

	// Targets
	//strType.LoadString(IDS_DEVPROP_HW_TARGET_COUNT);
	//strValue.Format(_T("%d"), pDevHWInfo->NumberOfTargets);
	//m_propList.AddItem(PropCreateSimple(strType, strValue));

	// Max Targets
	strType.LoadString(IDS_DEVPROP_HW_MAX_TARGET_COUNT);
	strValue.Format(_T("%d"), pDevHWInfo->MaximumNumberOfTargets);
	m_propList.AddItem(PropCreateSimple(strType, strValue));

	// Max LUs
	strType.LoadString(IDS_DEVPROP_HW_MAX_LU_COUNT);
	strValue.Format(_T("%d"), pDevHWInfo->MaximumNumberOfLUs);
	m_propList.AddItem(PropCreateSimple(strType, strValue));

	boost::shared_ptr<const NDAS_DEVICE_HARDWARE_INFO> phwi = m_pDevice->GetHardwareInfo();
	if (NULL != phwi.get() && 
		!IsNullNdasDeviceId(phwi->NdasDeviceId))
	{
		strType.LoadString(IDS_DEVPRO_HW_MAC_ADDRESS);
		strValue.Format(_T("%02X:%02X:%02X:%02X:%02X:%02X"),
			phwi->NdasDeviceId.Node[0],
			phwi->NdasDeviceId.Node[1],
			phwi->NdasDeviceId.Node[2],
			phwi->NdasDeviceId.Node[3],
			phwi->NdasDeviceId.Node[4],
			phwi->NdasDeviceId.Node[5]);
		m_propList.AddItem(PropCreateSimple(strType, strValue));
	}

	//
	// Unit Device Hardware Information
	//

	const ndas::UnitDeviceVector& unitDevices = m_pDevice->GetUnitDevices();
	for (DWORD i = 0; i < unitDevices.size(); ++i) 
	{
		ndas::UnitDevicePtr pUnitDevice = unitDevices.at(i);

		const NDAS_UNITDEVICE_HARDWARE_INFO* pHWI = pUnitDevice->GetHWInfo();

		strValue.FormatMessage(IDS_DEVPROP_UNITDEV_TITLE_FMT, i + 1);

		m_propList.AddItem(PropCreateCategory(strValue));

		if (NULL == pHWI) 
		{
			// "Not available"
			CString str = MAKEINTRESOURCE(IDS_UNITDEVICE_HARDWARE_INFO_NA);
			m_propList.AddItem(PropCreateSimple(str, _T("")));
			continue;
		}

		// Media Type
		strType.LoadString(IDS_DEVPROP_UNITDEV_DEVICE_TYPE);
		pUnitDeviceMediaTypeString(strValue, pHWI->MediaType);
		m_propList.AddItem(PropCreateSimple(strType, strValue));

		CString modeDelimiter(MAKEINTRESOURCE(IDS_MODE_DELIMITER));

		// Transfer Mode
		strType.LoadString(IDS_DEVPROP_UNITDEV_TRANSFER_MODE);
		strValue = _T("");
		{
			const struct { 
				const BOOL& Mode;
				UINT ResID;
			} TransferModeStrings[] = {
				pHWI->PIO, IDS_TRANSFER_MODE_PIO,
				pHWI->DMA, IDS_TRANSFER_MODE_DMA,
				pHWI->UDMA, IDS_TRANSFER_MODE_UDMA
			};

			bool multipleModes = false;
			for (int i = 0; i < RTL_NUMBER_OF(TransferModeStrings); ++i)
			{
				if (multipleModes) strValue += modeDelimiter;
				if (TransferModeStrings[i].Mode)
				{
					strValue += CString(MAKEINTRESOURCE(TransferModeStrings[i].ResID));
					multipleModes = true;
				}
			}
			m_propList.AddItem(PropCreateSimple(strType, strValue));
		}


		// LBA support?
		strType.LoadString(IDS_DEVPROP_UNITDEV_LBA_MODE);
		strValue = _T("");
		{
			const struct { 
				const BOOL& Mode;
				UINT ResID;
			} LbaModeStrings[] = {
				pHWI->LBA, IDS_LBA_MODE_LBA,
				pHWI->LBA48, IDS_LBA_MODE_LBA48
			};

			bool multipleModes = false;
			for (int i = 0; i < RTL_NUMBER_OF(LbaModeStrings); ++i)
			{
				if (multipleModes) strValue += modeDelimiter;
				if (LbaModeStrings[i].Mode)
				{
					strValue += CString(MAKEINTRESOURCE(LbaModeStrings[i].ResID));
					multipleModes = true;
				}
			}
			m_propList.AddItem(PropCreateSimple(strType, strValue));
		}

		// Model
		strType.LoadString(IDS_DEVPROP_UNITDEV_MODEL);
		strValue = pHWI->Model;
		strValue.TrimLeft();
		strValue.TrimRight(); 
		m_propList.AddItem(PropCreateSimple(strType, strValue));

		// FWRev
		strType.LoadString(IDS_DEVPROP_UNITDEV_FWREV);
		strValue = pHWI->FirmwareRevision;
		strValue.TrimLeft();
		strValue.TrimRight(); 
		m_propList.AddItem(PropCreateSimple(strType, strValue));

		// Serial No
		strType.LoadString(IDS_DEVPROP_UNITDEV_SERIALNO);
		strValue = pHWI->SerialNumber;
		strValue.TrimLeft();
		strValue.TrimRight(); 
		m_propList.AddItem(PropCreateSimple(strType, strValue));
	}

	return 0;
}
void CPropertyView::AddProperties(SPropertyList *pPL)
{
	HPROPERTY hProp = NULL;
	LPCSTR szLastProperty = "";
	for(int i=0; i<pPL->nProperties; i++) {
		if(pPL->aProperties[i].eType == SProperty::ptCategory) {
			szLastProperty = pPL->aProperties[i].szPropName;
		}
		hProp = m_ctrlList.FindProperty(pPL->aProperties[i].szPropName, szLastProperty);
		if(hProp) {
			if(pPL->aProperties[i].eType != SProperty::ptCategory) {
				if( pPL->aProperties[i].eType == SProperty::ptString ||
					pPL->aProperties[i].eType == SProperty::ptUCString ||
					pPL->aProperties[i].eType == SProperty::ptLCString ) {
					CComVariant vValue = pPL->aProperties[i].szString;
					m_ctrlList.SetItemValue(hProp, &vValue);
				} else 
				if( pPL->aProperties[i].eType == SProperty::ptARGBColor ||
					pPL->aProperties[i].eType == SProperty::ptRGBColor ) {
					RGBQUAD Color = (RGBQUAD)ARGBCOLOR(pPL->aProperties[i].rgbColor);
					CComVariant vValue = (int)(*(DWORD*)&Color);
					m_ctrlList.SetItemValue(hProp, &vValue);
				} else 
				if( pPL->aProperties[i].eType == SProperty::ptValue ||
					pPL->aProperties[i].eType == SProperty::ptRangeValue ) {
					CComVariant vValue = pPL->aProperties[i].nValue;
					m_ctrlList.SetItemValue(hProp, &vValue);
				} else 
				if( pPL->aProperties[i].eType == SProperty::ptBoolean ) {
					CComVariant vValue = (int)(pPL->aProperties[i].bBoolean & 1);
					m_ctrlList.SetItemValue(hProp, &vValue);
				} else 
				if( pPL->aProperties[i].eType == SProperty::ptList ) {
					CComVariant vValue = pPL->aProperties[i].nIndex;
					m_ctrlList.SetItemValue(hProp, &vValue);
				}
			}
			if(hProp) {
				m_ctrlList.SetItemEnabled(hProp, pPL->aProperties[i].bEnabled);
				m_ctrlList.SetItemMultivalue(hProp, pPL->aProperties[i].bMultivalue);
			}
		} else {
			if( pPL->aProperties[i].eType == SProperty::ptCategory ) {
				hProp = m_ctrlList.AddItem( PropCreateCategory(pPL->aProperties[i].szPropName) );
			} else 
			if( pPL->aProperties[i].eType == SProperty::ptString ) {
				hProp = m_ctrlList.AddItem( PropCreateSimple(pPL->aProperties[i].szPropName, pPL->aProperties[i].szString) );
			} else 
			if( pPL->aProperties[i].eType == SProperty::ptUCString ) {
				hProp = m_ctrlList.AddItem( PropCreateSimple(pPL->aProperties[i].szPropName, pPL->aProperties[i].szString, ES_UPPERCASE) );
			} else 
			if( pPL->aProperties[i].eType == SProperty::ptLCString ) {
				hProp = m_ctrlList.AddItem( PropCreateSimple(pPL->aProperties[i].szPropName, pPL->aProperties[i].szString, ES_LOWERCASE) );
			} else 
			if( pPL->aProperties[i].eType == SProperty::ptValue ) {
				hProp = m_ctrlList.AddItem( PropCreateSimple(pPL->aProperties[i].szPropName, pPL->aProperties[i].nValue) );
			} else
			if( pPL->aProperties[i].eType == SProperty::ptARGBColor ) {
				hProp = m_ctrlList.AddItem( PropCreateColor(pPL->aProperties[i].szPropName, (RGBQUAD)ARGBCOLOR(pPL->aProperties[i].rgbColor), TRUE) );
			} else 
			if( pPL->aProperties[i].eType == SProperty::ptRGBColor ) {
				hProp = m_ctrlList.AddItem( PropCreateColor(pPL->aProperties[i].szPropName, (RGBQUAD)ARGBCOLOR(pPL->aProperties[i].rgbColor), FALSE) );
			} else 
			if( pPL->aProperties[i].eType == SProperty::ptRangeValue ) {
				hProp = m_ctrlList.AddItem( PropCreateSimple(pPL->aProperties[i].szPropName, pPL->aProperties[i].nValue, 
					pPL->aProperties[i].nLowerRange, pPL->aProperties[i].nHigherRange, 
					pPL->aProperties[i].dwSlider) );
			} else 
			if( pPL->aProperties[i].eType == SProperty::ptBoolean ) {
				hProp = m_ctrlList.AddItem( PropCreateSimple(pPL->aProperties[i].szPropName, pPL->aProperties[i].bBoolean) );
			} else 
			if( pPL->aProperties[i].eType == SProperty::ptList ) {
				hProp = m_ctrlList.AddItem( PropCreateList( pPL->aProperties[i].szPropName, pPL->aProperties[i].List, pPL->aProperties[i].nIndex) );
			}

			if(hProp) {
				m_ctrlList.SetItemEnabled(hProp, pPL->aProperties[i].bEnabled);
				m_ctrlList.SetItemMultivalue(hProp, pPL->aProperties[i].bMultivalue);
			}
		}
	}
	memset(&m_PropertyList, 0, sizeof(SPropertyList));
	m_PropertyList.Merge(pPL); // save the properties for later.
}