Microsoft MVP성태의 닷넷 이야기
Vista : 8. Property System 사용 코드 예 [링크 복사], [링크+제목 복사],
조회: 11389
글쓴 사람
정성태 (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)
500정성태11/2/20069617TFS : 50. TfsAlert 0.3.0.0 릴리스
499정성태11/2/200610207개발 환경 구성: 50. VS.NET, .NET Framework QFE 패치
498정성태11/4/20069731TFS : 49. Team Foundation Administrator's Guide 문서 업데이트
497정성태11/1/20069695개발 환경 구성: 49. IE 7 의 "Search Provider" 기능 소개
496정성태11/4/20069214.NET : 26. Download the New Composite UI Application Block Reference Application from IdeaBlade
495정성태11/1/20069292개발 환경 구성: 48. XamlPadX (extended)
494정성태11/1/200610165TFS : 48. SandCastle Team Build targets 파일파일 다운로드1
493정성태10/31/20069447VS.NET IDE : 12. [Orcas] TreeDiff 지원
492정성태10/31/20069965개발 환경 구성: 47. SandCastle 과 NAnt 의 결합
491정성태10/28/200610104SDK : 4. PE/COFF 스펙
490정성태11/4/200613900.NET : 25. C# "const" 키워드와 "static readonly"의 차이
489정성태10/28/200610423Visual C++ : 4. VC++ 8.0 override 키워드 이해 [1]
488정성태10/26/20069834TFS : 47. TFS Application Tier 로부터 Sharepoint 분리해서 설치하는 방법
487정성태10/26/200610100TFS : 46. Project Server 2003 - Team Foundation connector released
486정성태10/25/20069300개발 환경 구성: 46. VS.NET Addin - 디렉터리 단위로 링크 방식으로 파일 추가
485정성태10/23/20069933.NET 3.0 : 5. WinFX (.NET 3.0) Series Presentation Slides
484정성태10/20/20069587개발 환경 구성: 45. Microsoft Best Practices Analyzer 1.0
483정성태10/20/20069372.NET 3.0 : 4. HostNameComparisonMode 의 이해
482정성태10/29/20069754TFS : 45. TeamPlain 1.1 now available
481정성태10/19/20069820TFS : 44. Project Server 2003 and Visual Studio Team System 2005 connector available!
480정성태10/19/20069630개발 환경 구성: 44. IE 7 에 포함된 RSS Platform MiniSDK파일 다운로드1
479정성태10/18/200610234x64 : 2. dynamic_cast is slow in x64
478정성태10/18/20069954개발 환경 구성: 43. IE 7 에서 달라지는 Accept-Language 헤더
477정성태10/18/20069802.NET : 24. ADO.Net 성능 향상 팁
476정성태10/18/200610969TFS : 43. WorkItem 항목 삭제
475정성태11/8/200610061개발 환경 구성: 42. VHD 파일을 가상 하드 디스크로 설정하는 방법파일 다운로드1
... 16  17  18  19  20  21  22  23  24  25  26  27  [28]  29  30  ...