Microsoft MVP성태의 닷넷 이야기
Vista : 8. Property System 사용 코드 예 [링크 복사], [링크+제목 복사],
조회: 11357
글쓴 사람
정성태 (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)
450정성태9/28/20069598.NET : 16. ADO.NET vNext Entity Data Model Designer Prototype, CTP
449정성태9/28/200610496TFS : 37. Team Foundation Server and Basic Authentication
448정성태9/28/200610062TFS : 36. Moving the Team Foundation Server Data Warehouse to a Separate Server
447정성태10/20/200610184Vista : 10. ASLR이 적용된 Vista
446정성태9/26/20069977개발환경 구성 : 31. Profiling Tool for .NET Developers
445정성태10/20/20069644Windows 2008 : 2. LHS Feature Of The Week #2 - Remote Differential Compression
444정성태10/20/200610207Windows 2008 : 1. LHS Feature Of The Week #1 - Transactional NTFS
443정성태9/23/200610093개발환경 구성 : 30. Tip/Trick: Optimizing ASP.NET 2.0 Web Project Build Performance with VS 2005
442정성태9/28/200610665TFS : 35. 설치 설명서 / 관리자 가이드 도움말 업데이트
441정성태9/21/200611150개발환경 구성 : 29. SQL Server Spec 비교
440정성태10/20/200610546.NET 3.0 : 3. WCF Workshops updated to Release Candidate 1
439정성태9/20/200610539개발환경 구성 : 28. Caml Viewer 2007 : released on Codeplex
438정성태9/20/200610310개발환경 구성 : 27. Enterprise Smart Card Deployment in the Microsoft® Windows® Smart Card Framework
437정성태9/19/200610243TFS : 34. Getting Started with TFS Integrator 파일 다운로드2
434정성태9/20/200610956개발환경 구성 : 26. Developing Web Applications on Windows Vista with Visual Studio 2005
433정성태10/20/200610403Vista : 9. Next Generation TCP/IP Stack
432정성태9/16/200610285TFS : 33. Now Available: Teamprise V2 Preview 2
431정성태9/16/20069926개발환경 구성 : 25. Announcing the Web Client Software Factory
430정성태9/15/200610274.NET : 15. ASP.NET 2.0 - A Preview of Web LINQ - BLINQ
429정성태9/15/20069854The True Cost of .NET Exceptions
428정성태9/15/200611646.NET : 14. IronPython 예제들
427정성태9/14/200611135개발환경 구성 : 24. Smart Start and Stop Service in VS.NET Build
426정성태9/13/200610561TFS : 32. Team Foundation Server Language Change Package
425정성태9/12/200610409TFS : 31. Team Foundation Administrator's Guide (TFSAdmin.chm)
424정성태9/12/200611077Visual C++ : 2. Managed Debugger Expression Evaluator - mcee_mc.dat
422정성태9/8/200610973.NET : 13. An Introduction to LINQ
... 16  17  18  19  20  21  22  23  24  25  26  27  28  29  [30]  ...