Microsoft MVP성태의 닷넷 이야기
Vista : 8. Property System 사용 코드 예 [링크 복사], [링크+제목 복사],
조회: 11343
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
부모글 보이기/감추기

Property consumerism
; https://learn.microsoft.com/en-us/archive/blogs/benkaras/property-consumerism

약속대로 코드 예제를 공개했습니다.

별로 많은 내용이 아니니, 여기에 복사해 넣습니다.


Reading properties is rather simple. First, bind to the item. SHCreateItemFromIDList and SHCreateItemFromParsingName are appropriate for this. Then read your properties. Be sure to clean up after yourself.

IShellItem2 *psi;
if (SUCCEEDED(SHCreateItemFromParsingName(L"c:\tortoise.doc", NULL, IID_IShellItem2, (void**)&psi)))
{
IPropertyStore *pps;
if (SUCCEEDED(psi->GetPropertyStore(GPS_DEFAULT, IID_IPropertyStore, (void**)&pps)))
{
PROPVARIANT propvar = {0};
if (SUCCEEDED(pps->GetValue(PKEY_Title, &propvar)))
{
wprintf(L"Title: %s\n", PropVariantToStringWithDefault(propvar, L""));
PropVariantClear(&propvar);
}
pps->Release();
}
psi->Release();
}

Not bad for reading the title of a document! And I even checked the return results.

---

Constable Umer walked down the narrow flagstone path, then onto cobblestones and finally gravel stones. Turning a corner, Cons. Umer found a door with a small card pinned to next to it. "Great Flying Tortoise: Purveyor of fine, proper teas."








[최초 등록일: ]
[최종 수정일: 4/26/2024]


비밀번호

댓글 작성자
 



2006-10-06 10시35분
Properties coding expedition #1 - Binding to an item
; https://learn.microsoft.com/en-us/archive/blogs/benkaras/properties-coding-expedition-1-binding-to-an-item

Properties coding expedition #2 - printing the IPropertyStore
; https://learn.microsoft.com/en-us/archive/blogs/benkaras/properties-coding-expedition-2-printing-the-ipropertystore

Properties coding expedition #3 - Printing a value
; https://learn.microsoft.com/en-us/archive/blogs/benkaras/properties-coding-expedition-3-printing-a-value

Properties coding expedition #4 - The output
; https://learn.microsoft.com/en-us/archive/blogs/benkaras/properties-coding-expedition-4-the-output

Properties coding expedition #5 - Stripping characters
; https://learn.microsoft.com/en-us/archive/blogs/benkaras/properties-coding-expedition-5-stripping-characters

Properties coding expedition #6 - Developer friendly output
; https://learn.microsoft.com/en-us/archive/blogs/benkaras/properties-coding-expedition-6-developer-friendly-output

Properties coding expedition #7 - The final output
; https://learn.microsoft.com/en-us/archive/blogs/benkaras/properties-coding-expedition-7-the-final-output
kevin25

... 31  32  33  34  35  [36]  37  38  39  40  41  42  43  44  45  ...
NoWriterDateCnt.TitleFile(s)
296정성태5/27/20069412WWF 로 만든 Tetris
294정성태5/21/20069483Session State Uses a Reader-Writer Lock
293정성태5/21/20068271Microsoft Threat Analysis & Modeling v2.0 RC1
291정성태5/18/20069547Managed Stack Explorer
289정성태5/17/20069940Microsoft ASP.NET Providers - PDF 메뉴얼
288정성태5/17/200610301TFS Administration Tool 1.0 Released...with Shared Source!
287정성태5/17/20069444An Introduction to 64-bit Installers with Visual Studio 2005: Part 1
283정성태5/15/200610026Windows Workflow Foundation: Running Service Activated Workflows on Windows Vista and IIS7
284정성태5/15/200610202    답변글 Windows Workflow Foundation: Exposing Workflows as Services [1]
281정성태5/12/20068797Microsoft Compute Cluster Pack SDK
280정성태5/11/20069087C# 3.0 : One-Step Object Creation and Initialization
279정성태5/11/200610976Vista에서 제거되는 DHTML Editing Control
278정성태5/11/20069033LINQ CTP - May 2006
286정성태5/16/20068479    답변글 Using LINQ with ASP.NET (Part 1)
277정성태5/9/20068717Web Application Projects - 정식 릴리스
276정성태5/8/20069010SNK 파일 공유하기파일 다운로드1
275정성태5/8/20068729Building Security Awareness in .NET Assemblies
274정성태5/7/20068624QuickSYS파일 다운로드2
273정성태5/7/20068899Developing Firewalls for Windows 2000/XP파일 다운로드1
272정성태5/6/200610883Windows PowerShell [3]
292정성태5/19/20069000    답변글 Windows PowerShell - PowerShell Script to Create a WorkItem
271정성태5/6/20069109MSBee
282정성태5/15/20068933    답변글 MSBee will be on CodePlex
290정성태5/18/20069308    답변글 MSBuild Extras - Toolkit for .NET 1.1 "MSBee"
270정성태5/4/20069136ISO Recorder
269정성태5/4/20069002Visual Studio 2005 Team System Level 200 Course Material
... 31  32  33  34  35  [36]  37  38  39  40  41  42  43  44  45  ...