Share via


PSGetPropertyDescriptionByName 函式 (propsys.h)

取得指定屬性名稱的屬性描述介面實例。

語法

PSSTDAPI PSGetPropertyDescriptionByName(
  [in]  LPCWSTR pszCanonicalName,
  [in]  REFIID  riid,
  [out] void    **ppv
);

參數

[in] pszCanonicalName

類型: LPCWSTR

以 Null 結尾的 Unicode 字串指標,可識別 屬性。

[in] riid

類型: REFIID

所要求屬性之介面識別碼的參考。

[out] ppv

類型: void**

當此函式傳回時,包含 riid中要求的介面指標。 這通常是 IPropertyDescriptionIPropertyDescriptionAliasInfoIPropertyDescriptionSearchInfo

傳回值

類型: PSSTDAPI

傳回下列其中一個值。

傳回碼 描述
S_OK
已取得 介面。
E_INVALIDARG
pszCanonicalName參數為Null
TYPE_E_ELEMENTNOTFOUND
架構子系統快取中不存在標準名稱。

備註

建議您使用 objbase.h 中定義的 IID_PPV_ARGS 宏來封裝 riidppv 參數。 這個宏會根據 ppv中值所指向的介面提供正確的 IID,消除編碼錯誤的可能性。

我們建議 pszCanonicalName 指向屬性的正式名稱,例如 L"System.Keywords" 。 標準名稱區分大小寫。

除了新的標準名稱之外,呼叫端還可以傳遞屬性的舊版名稱。 下表包含所支援舊版名稱的完整清單,以及它們對應的標準名稱。

屬性名稱 對應至屬性
Access System.DateAccessed
專輯 System.Music.AlbumTitle
AllocSize System.FileAllocationSize
孔徑 System.Photo.Aperture
演出者 System.Music.Artist
Attrib System.FileAttributes
屬性 System.FileAttributes
AttributesDescription System.FileAttributesDisplay
音訊格式 System.Audio.Format
音訊範例大小 System.Audio.SampleSize
BitDepth System.Image.BitDepth
Bitrate System.Audio.EncodingBitrate
CameraModel System.Photo.CameraModel
Capacity System.Capacity
通道 System.Audio.ChannelCount
ColorSpace System.Image.ColorSpace
公司 System.Company
壓縮 System.Video.Compression
壓縮 System.Video.Compression
著作權 System.Copyright
著作權 System.Copyright
著作權 System.Image.Copyright
建立 System.DateCreated
CSCStatus System.OfflineStatus
資料速率 System.Video.EncodingBitrate
DateDeleted System.Recycle.DateDeleted
DeletedFrom System.Recycle.DeletedFrom
維度 System.Image.Dimensions
Directory System.ItemFolderNameDisplay
距離 System.Photo.SubjectDistance
DocAppName System.ApplicationName
DocAuthor System.Author
DocByteCount System.Document.ByteCount
DocCategory System.Category
DocCharCount System.Document.CharacterCount
DocComments System.Comment
DocCompany System.Company
DocCreatedTm System.Document.DateCreated
DocEditTime System.Document.TotalEditingTime
DocHiddenCount System.Document.HiddenSlideCount
DocKeywords System.Keywords
DocLastAuthor System.Document.LastAuthor
DocLastPrinted System.Document.DatePrinted
DocLastSavedTm System.Document.DateSaved
DocLineCount System.Document.LineCount
DocManager System.Document.Manager
DocNoteCount System.Document.NoteCount
DocPageCount System.Document.PageCount
DocParaCount System.Document.ParagraphCount
DocPresentationTarget System.Document.PresentationFormat
DocRevNumber System.Document.RevisionNumber
DocSlideCount System.Document.SlideCount
DocSubject System.Subject
DocTemplate System.Document.Template
DocTitle System.Title
DocWordCount System.Document.WordCount
DRM 描述 System.DRM.Description
持續時間 System.Media.Duration
EquipMake System.Photo.CameraManufacturer
ExposureBias System.Photo.ExposureBias
ExposureProg System.Photo.ExposureProgram
ExposureTime System.Photo.ExposureTime
FaxCallerID System.Fax.CallerID
FaxCSID System.Fax.CSID
FaxRecipientName System.Fax.RecipientName
FaxRecipientNumber System.Fax.RecipientNumber
FaxRouting System.Fax.Routing
FaxSenderName System.Fax.SenderName
FaxTime System.Fax.Time
FaxTSID System.Fax.TSID
FileDescription System.FileDescription
FileSystem System.Volume.FileSystem
FileType System.Image.FileType
FileVersion System.FileVersion
閃爍 System.Photo.Flash
FlashEnergy System.Photo.FlashEnergy
FNumber System.Photo.FNumber
FocalLength System.Photo.FocalLength
畫面播放速率 System.Video.FrameRate
FrameCount System.Media.FrameCount
FreeSpace System.FreeSpace
Genre System.Music.Genre
ImageX System.Image.HorizontalSize
ImageY System.Image.VerticalSize
ISOSpeed System.Photo.ISOSpeed
LightSource System.Photo.LightSource
LinksUpToDate System.Document.LinksDirty
LinkTarget System.Link.TargetParsingPath
Lyrics System.Music.Lyrics
管理員 System.Document.Manager
MeteringMode System.Photo.MeteringMode
MMClipCount System.Document.MultimediaClipCount
名稱 System.ItemNameDisplay
擁有者 System.FileOwner
播放次數 System.DRM.PlayCount
播放到期 System.DRM.DatePlayExpires
播放開始 System.DRM.DatePlayStarts
PresentationTarget System.Document.PresentationFormat
ProductName System.Software.ProductName
ProductVersion System.Software.ProductVersion
專案 System.Media.Project
Protected System.DRM.IsProtected
Rank System.Search.Rank
分級 System.Rating
ResolutionX System.Image.HorizontalResolution
ResolutionY System.Image.VerticalResolution
採樣速率 System.Audio.SampleRate
調整 System.Document.Scale
ShutterSpeed System.Photo.ShutterSpeed
大小 System.Size
軟體 System.SoftwareUsed
狀態 System.Media.Status
狀態 System.Status
資料流程名稱 System.Video.StreamName
SyncCopyIn System.Sync.CopyIn
Track System.Music.TrackNumber
類型 System.ItemTypeText
影片範例大小 System.Video.SampleSize
WhenTaken System.Photo.DateTaken
Write System.DateModified
System.Media.Year
 

範例

下列範例要包含在較大的程式中,示範如何使用 PSGetPropertyDescriptionByName 來擷取 ratings 屬性的描述。

IPropertyDescription *pPropDesc;

HRESULT hr = PSGetPropertyDescriptionByName(L"System.Rating", IID_PPV_ARGS(&pPropDesc))

if (SUCCEEDED(hr))
{
    // pPropDesc is now valid.
 
    pPropDesc->Release();
}

需求

   
最低支援的用戶端 Windows XP 搭配 SP2、Windows Vista [僅限傳統型應用程式]
最低支援的伺服器 Windows Server 2003 SP1 [僅限傳統型應用程式]
目標平台 Windows
標頭 propsys.h
程式庫 Propsys.lib
Dll Propsys.dll (5.0 版或更新版本)
可轉散發套件 Windows 桌面搜尋 (WDS) 3.0

另請參閱

IPropertySystem

PSGetPropertyDescription