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

1  2  3  4  5  6  7  8  9  10  11  12  [13]  14  15  ...
NoWriterDateCnt.TitleFile(s)
875정성태11/9/200710357.NET : 66. 한 눈으로 확인하는 .NET 데이터 액세스 계층
874정성태11/6/200711411Debug : 30. OpenFileDialog 사용시 메모리 사용이 급격하게 올라가는 문제
873정성태11/6/200710483Debug : 29. WinDBG - 명령어 !IToldYouSo
872정성태11/3/200710590Debug : 28. Debugger Visualizer - DynamicMethod / MethodInfo [1]
871정성태10/31/200710803TFS : 141. VS.NET 2008 - 개선된 WorkItem 기능
870정성태10/31/200710475TFS : 140. TFS to TFS Migration Tool
869정성태10/31/200710617.NET : 65. ASP.NET 을 어셈블리 언어로.
868정성태10/30/200710830.NET 3.0 : 23. 카드 스페이스 - SSL 없이도 구현가능.
867정성태10/30/200710741.NET : 64. CAB(Composite Application Block) 에 접근하고 싶으세요?
866정성태10/28/200710670개발 환경 구성: 115. VPC 를 이용한 AD 네트워크 구성
865정성태10/27/200710830.NET : 63. Singleton 패턴 구현
864정성태10/23/200710857TFS : 139. 단위 테스트를 MTA로 실행하도록 설정 [1]
863정성태10/20/200710614VisualNDepend
862정성태10/20/200710117.NET : 62. CAB 성능 향상 팁
861정성태10/20/200710498Debug : 27. SOS 를 이용하여 .NET Finalizer 디버깅
860정성태10/18/200710491TFS : 138. 팀 규모에 따른 물리 서버의 용량
859정성태10/16/200711412개발 환경 구성: 114. Eric Gunnerson 의 WiX 관련 포스트들 [3]
858정성태10/16/200710711.NET : 61. 메서드 안에서 정의된 블록 내부의 변수에 대한 범위
857정성태10/9/200710348TFS : 137. 특정 버전의 소스로 팀 빌드하는 방법
856정성태10/8/200711734.NET 3.5 : 32. ReaderWriterLock 과 ReaderWriterLockSlim 의 성능 비교.
855정성태10/5/200710465개발 환경 구성: 113. Virtual PC - 처음 생성한 VHD 파일의 크기를 바꿀 수 있을까?
854정성태10/3/200710335TFS : 136. Operations Guidance for Team Foundation Server
853정성태10/2/200710737.NET 3.5 : 31. ToJSON 확장 메서드 구현
852정성태9/30/200711866IIS : 18. IIS 7.0 의 FTP 서비스를 위한 방화벽 설정
851정성태9/27/200710889TFS : 135. TFS 2008 용 빌드 알림 도구
850정성태9/26/200710171TFS : 134. Visual Studio Team System Web Access 2008 파워툴 CTP
1  2  3  4  5  6  7  8  9  10  11  12  [13]  14  15  ...