void CPanel::Properties() { CMyComPtr<IGetFolderArchiveProperties> getFolderArchiveProperties; _folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties); if (!getFolderArchiveProperties) { InvokeSystemCommand("properties"); return; } { UString message; CRecordVector<UInt32> operatedIndices; GetOperatedItemIndices(operatedIndices); if (operatedIndices.Size() == 1) { UInt32 index = operatedIndices[0]; // message += L"Item:\n"; UInt32 numProps; if (_folder->GetNumberOfProperties(&numProps) == S_OK) { for (UInt32 i = 0; i < numProps; i++) { CMyComBSTR name; PROPID propID; VARTYPE varType; if (_folder->GetPropertyInfo(i, &name, &propID, &varType) != S_OK) continue; NCOM::CPropVariant prop; if (_folder->GetProperty(index, propID, &prop) != S_OK) continue; AddPropertyString(propID, name, prop, message); } } message += kSeparator; } message += LangString(IDS_PROPERTY_FILE_TYPE, 0x02000214); message += kPropValueSeparator; message += GetFolderTypeID(); message += L"\n"; { NCOM::CPropVariant prop; if (_folder->GetFolderProperty(kpidPath, &prop) == S_OK) { AddPropertyString(kpidName, L"Path", prop, message); } } CMyComPtr<IFolderProperties> folderProperties; _folder.QueryInterface(IID_IFolderProperties, &folderProperties); if (folderProperties) { UInt32 numProps; if (folderProperties->GetNumberOfFolderProperties(&numProps) == S_OK) { for (UInt32 i = 0; i < numProps; i++) { CMyComBSTR name; PROPID propID; VARTYPE vt; if (folderProperties->GetFolderPropertyInfo(i, &name, &propID, &vt) != S_OK) continue; NCOM::CPropVariant prop; if (_folder->GetFolderProperty(propID, &prop) != S_OK) continue; AddPropertyString(propID, name, prop, message); } } } CMyComPtr<IGetFolderArchiveProperties> getFolderArchiveProperties; _folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties); if (getFolderArchiveProperties) { CMyComPtr<IFolderArchiveProperties> getProps; getFolderArchiveProperties->GetFolderArchiveProperties(&getProps); if (getProps) { UInt32 numProps; if (getProps->GetNumberOfArchiveProperties(&numProps) == S_OK) { if (numProps > 0) message += kSeparator; for (UInt32 i = 0; i < numProps; i++) { CMyComBSTR name; PROPID propID; VARTYPE vt; if (getProps->GetArchivePropertyInfo(i, &name, &propID, &vt) != S_OK) continue; NCOM::CPropVariant prop; if (getProps->GetArchiveProperty(propID, &prop) != S_OK) continue; AddPropertyString(propID, name, prop, message); } } } } ::MessageBoxW(*(this), message, LangString(IDS_PROPERTIES, 0x03020900), MB_OK); } }
void CPlugin::GetOpenPluginInfo(struct OpenPluginInfo *info) { info->StructSize = sizeof(*info); info->Flags = OPIF_USEFILTER | OPIF_USESORTGROUPS| OPIF_USEHIGHLIGHTING| OPIF_ADDDOTS | OPIF_COMPAREFATTIME; UINT codePage = ::AreFileApisANSI() ? CP_ACP : CP_OEMCP; MyStringCopy(m_FileNameBuffer, (const char *)UnicodeStringToMultiByte(m_FileName, codePage)); info->HostFile = m_FileNameBuffer; // test it it is not static MyStringCopy(m_CurrentDirBuffer, (const char *)UnicodeStringToMultiByte(m_CurrentDir, CP_OEMCP)); info->CurDir = m_CurrentDirBuffer; info->Format = kPluginFormatName; UString name; { UString fullName; int index; NFile::NDirectory::MyGetFullPathName(m_FileName, fullName, index); name = fullName.Mid(index); } m_PannelTitle = UString(L' ') + _archiveTypeName + UString(L':') + name + UString(L' '); if (!m_CurrentDir.IsEmpty()) { // m_PannelTitle += '\\'; m_PannelTitle += m_CurrentDir; } MyStringCopy(m_PannelTitleBuffer, (const char *)UnicodeStringToMultiByte(m_PannelTitle, CP_OEMCP)); info->PanelTitle = m_PannelTitleBuffer; memset(m_InfoLines, 0, sizeof(m_InfoLines)); MyStringCopy(m_InfoLines[0].Text, ""); m_InfoLines[0].Separator = TRUE; MyStringCopy(m_InfoLines[1].Text, g_StartupInfo.GetMsgString(NMessageID::kArchiveType)); MyStringCopy(m_InfoLines[1].Data, (const char *)UnicodeStringToMultiByte(_archiveTypeName, CP_OEMCP)); int numItems = 2; { CMyComPtr<IFolderProperties> folderProperties; _folder.QueryInterface(IID_IFolderProperties, &folderProperties); if (folderProperties) { UInt32 numProps; if (folderProperties->GetNumberOfFolderProperties(&numProps) == S_OK) { for (UInt32 i = 0; i < numProps && numItems < kNumInfoLinesMax; i++) { CMyComBSTR name; PROPID propID; VARTYPE vt; if (folderProperties->GetFolderPropertyInfo(i, &name, &propID, &vt) != S_OK) continue; NCOM::CPropVariant prop; if (_folder->GetFolderProperty(propID, &prop) != S_OK || prop.vt == VT_EMPTY) continue; InfoPanelLine &item = m_InfoLines[numItems++]; MyStringCopy(item.Text, (const char *)GetNameOfProp2(propID, name)); MyStringCopy(item.Data, (const char *)PropToString2(prop, propID)); } } } } if (numItems < kNumInfoLinesMax) { InfoPanelLine &item = m_InfoLines[numItems++]; MyStringCopy(item.Text, ""); MyStringCopy(item.Data, ""); item.Separator = TRUE; } { CMyComPtr<IGetFolderArchiveProperties> getFolderArchiveProperties; _folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties); if (getFolderArchiveProperties) { CMyComPtr<IFolderArchiveProperties> getProps; getFolderArchiveProperties->GetFolderArchiveProperties(&getProps); if (getProps) { UInt32 numProps; if (getProps->GetNumberOfArchiveProperties(&numProps) == S_OK) { /* if (numProps > 0) message += kSeparator; */ for (UInt32 i = 0; i < numProps && numItems < kNumInfoLinesMax; i++) { CMyComBSTR name; PROPID propID; VARTYPE vt; if (getProps->GetArchivePropertyInfo(i, &name, &propID, &vt) != S_OK) continue; NCOM::CPropVariant prop; if (getProps->GetArchiveProperty(propID, &prop) != S_OK || prop.vt == VT_EMPTY) continue; InfoPanelLine &item = m_InfoLines[numItems++]; MyStringCopy(item.Text, (const char *)GetNameOfProp2(propID, name)); MyStringCopy(item.Data, (const char *)PropToString2(prop, propID)); } } } } } //m_InfoLines[1].Separator = 0; info->InfoLines = m_InfoLines; info->InfoLinesNumber = numItems; info->DescrFiles = NULL; info->DescrFilesNumber = 0; PanelModeColumnTypes.Empty(); PanelModeColumnWidths.Empty(); /* AddColumn(kpidName); AddColumn(kpidSize); AddColumn(kpidPackedSize); AddColumn(kpidMTime); AddColumn(kpidCTime); AddColumn(kpidATime); AddColumn(kpidAttrib); PanelMode.ColumnTypes = (char *)(const char *)PanelModeColumnTypes; PanelMode.ColumnWidths = (char *)(const char *)PanelModeColumnWidths; PanelMode.ColumnTitles = NULL; PanelMode.FullScreen = TRUE; PanelMode.DetailedStatus = FALSE; PanelMode.AlignExtensions = FALSE; PanelMode.CaseConversion = FALSE; PanelMode.StatusColumnTypes = "N"; PanelMode.StatusColumnWidths = "0"; PanelMode.Reserved[0] = 0; PanelMode.Reserved[1] = 0; info->PanelModesArray = &PanelMode; info->PanelModesNumber = 1; */ info->PanelModesArray = NULL; info->PanelModesNumber = 0; info->StartPanelMode = 0; info->StartSortMode = 0; info->KeyBar = NULL; info->ShortcutData = NULL; }