Microsoft MVP성태의 닷넷 이야기
Vista : 8. Property System 사용 코드 예 [링크 복사], [링크+제목 복사],
조회: 11383
글쓴 사람
정성태 (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

... 16  [17]  18  19  20  21  22  23  24  25  26  27  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
775정성태6/11/200712058TFS : 105. Visual Studio Team Foundation Server ? Project Server 2007 Connector
774정성태6/10/200712063.NET 3.5 : 24. F#, Cω 를 통해보는 C# 3.0 기능들
773정성태6/10/200712573Vista : 45. HOW-TO: Disable Automatic Folder Type Discovery
772정성태6/9/200711077Debug : 20. How Windows Shuts Down
771정성태6/9/200711293VS.NET IDE : 34. .NET Client Application Services [1]
770정성태6/9/200710732TFS : 104. 팀 빌드 스케줄링
769정성태6/9/200711663.NET 3.5 : 23. the red bits and the green bits
768정성태6/9/200711797.NET 3.5 : 22. System.TimeZoneInfo
767정성태6/9/200711895Vista : 44. 이동 가능한 드라이브에 BitLocker 적용
766정성태6/9/200711185개발 환경 구성: 99. Virtualisation White Paper
765정성태6/9/200714078Debug : 19. IsDebuggerPresent API 이야기
764정성태6/6/200711281VS.NET IDE : 33. Visual Studio 2008 Shell - 사용자 정의 가능한 쉘 환경 구현
763정성태6/6/200710629.NET : 59. 스마트 클라이언트의 미래 - Acropolis
762정성태6/5/200711030.NET 3.5 : 21. VB.NET LINQ Hands On Labs for Orcas Beta 1
761정성태6/5/200710714Visual C++ : 10. C++-0x
760정성태6/1/200711196.NET 3.5 : 20. Jasper 프로젝트 문서
759정성태5/30/200710334TFS : 103. SDC - MSBuild Task Library
758정성태5/25/200710565.NET 3.5 : 19. LINQ to XSD Preview Alpha 0.2
757정성태5/25/200710515TFS : 102. SnagIt Output
756정성태5/25/20079171.NET : 58. IL inline 툴
755정성태5/24/200710081TFS : 101. Team Foundation Server Guide (beta1)
754정성태5/22/20079608SDK : 8. Microsoft Windows MultiPoint Software Development Kit (SDK) - CTP 2
753정성태5/22/200711154.NET 3.5 : 18. WCF 신규 바인딩 - WebHttpBinding
752정성태5/22/200712347Debug : 18. 무한 루프에 빠졌을 때.
751정성태5/22/200710274TFS : 100. LogParser 와 TFS
750정성태5/18/200711197IIS : 15. WCAT 6.3
... 16  [17]  18  19  20  21  22  23  24  25  26  27  28  29  30  ...