Microsoft MVP성태의 닷넷 이야기
Vista : 8. Property System 사용 코드 예 [링크 복사], [링크+제목 복사],
조회: 11386
글쓴 사람
정성태 (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)
700정성태3/27/20079584Visual C++ : 9. 실행시에 Manifest 파일 선택
699정성태3/26/200710282TFS : 91. TeamPlain 제품 TFS 라이선스를 통해 무료 제공
698정성태3/24/200710164Vista : 40. 바탕화면 공유 API
697정성태3/24/20079226개발 환경 구성: 87. IE 7 단축키
696정성태3/24/200710178.NET 3.5 : 11. LINQ to SQL - Linq 구문이 실제로 어떤 SQL 문인지 확인하는 방법
695정성태3/23/200714560개발 환경 구성: 86. 비스타 - 무선 ad-hoc 네트워크 생성파일 다운로드1
694정성태3/22/200710153TFS : 90. 브랜치 기능에 대한 가이드를 담은 문서 [1]
693정성태3/21/200710579Debug : 11. 프로세스 정지 상태를 위한 AdPlus 사용 예
692정성태3/20/200710869TFS : 89. 개별 솔루션에 대해 사용자 정의 속성값 전달하는 방법
691정성태3/19/200710152.NET 3.0 : 16. Visual Studio 2005 ToolBox for Windows CardSpace
690정성태3/19/200710180TFS : 88. 단위 테스트 - VSTS for DB Pro
689정성태3/19/200710029개발 환경 구성: 85. ASP.NET 2.0 을 사용하여 웹 표준 사이트 제작
688정성태3/14/200710680VS.NET IDE : 27. Func-eval 기능
687정성태3/14/200710129VS.NET IDE : 26. Orcas - VC++ /MPn 스위치
686정성태3/14/20079795TFS : 87. 64비트 시스템에서의 TFS 설치
685정성태3/14/20079880VS.NET IDE : 25. Orcas - 데이터 관련 툴 기능
684정성태3/14/200710534.NET 3.5 : 10. Extension Method
683정성태3/13/200710496.NET 3.5 : 9. 새로 추가된 TraceListener - EventSchemaTraceListener
682정성태3/13/200710613.NET 3.0 : 15. XAML 내용을 XPS 문서로 변환
681정성태3/13/20079969.NET 3.5 : 8. Orcas 3월 CTP 버전에 맞게 수정된 LINQ Samples
680정성태3/13/20079968.NET : 55. 비스타의 Command Link Control 사용
679정성태3/13/20079561VS.NET IDE : 24. Orcas - ClickOnce의 기능을 이어받는 IE 임베딩 유형의 스마트 클라이언트 [2]
678정성태3/9/20079836Debug : 10. MPI 프로그램에 대한 디버깅 환경 설정
677정성태3/8/200710429.NET 3.5 : 7. Orcas 3월 CTP 에 맞는 WF/WCF 예제 코드
676정성태3/8/20079799VS.NET IDE : 23. 문자열 다국어 지원을 위한 Refactoring Tool
675정성태3/7/20079508Debug : 9. 실행 시 IL 코드 교체 프로파일러
... 16  17  18  19  [20]  21  22  23  24  25  26  27  28  29  30  ...