Microsoft MVP성태의 닷넷 이야기
Vista : 8. Property System 사용 코드 예 [링크 복사], [링크+제목 복사],
조회: 11305
글쓴 사람
정성태 (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)
975정성태10/9/200810678.NET : 88. ClickOnce에서 .application 파일을 다운로드 하려고 할 때.
974정성태10/8/200810695TFS : 168. MSBuild Extension Pack
973정성태10/5/200812387.NET 3.5 : 42. WPF - Web Browser 및 Splash Control 추가
972정성태10/2/200810654TFS : 167. TFS Power Tools 다음 버전 소개
971정성태9/22/200810973TFS : 166. Index cards and Team System
970정성태9/16/200810961Vista : 53. 설치 디스크를 USB 로 만들기
968정성태9/11/200810565XML Conformance Level 에 Fragment 값이 쓰이는 경우.
967정성태9/8/200810698.NET : 87. CertEnroll 개체를 이용한 인증서 요청/반환/설치
966정성태9/2/200810748.NET : 86. .NET Framework 3.5 SP1 소스 코드 공개
965정성태9/2/200811699Vista : 52. SPI(Stateful Packet Inspection) 옵션 제거
964정성태8/18/200812703.NET 3.0 : 24. WPF DataGrid
969정성태9/16/200810974    답변글 .NET 3.0 : 24.1 Editing Tabular Data in WPF - Building a WPF Grid
963정성태7/25/200811774.NET : 85. VPL(Visual Programming Language)를 아세요?
962정성태7/24/200810836TFS : 165. WorkItem 에 대해 Full Text 검색
961정성태7/20/200810764.NET : 84. WCSF Application Architecture
960정성태7/14/200810606.NET : 83. Non Paged CLR Host
959정성태7/7/200811138.NET : 82. Composite Application Guidance for WPF
958정성태7/7/200812303.NET : 81. C# - 왜 모든 함수호출에서 callvirt 를 사용할까?
957정성태6/30/200811278GUID
956정성태6/27/200810784TFS : 164. 팀 프로젝트 간 WorkItem 이동 방법
955정성태6/26/200811295TFS : 163. 삭제된 항목을 소스 컨트롤 탐색기에서 보이도록 하는 방법
954정성태6/20/200810918Debug : 37. IDE 디자인 모드에서의 디버깅 기법
953정성태6/10/200811771.NET : 80. Unity Application Block 소개(?) [1]
952정성태4/28/200811040.NET : 79. IconHandler 2.0
951정성태4/28/200811467SDK : 14. STA / MTA 기원
950정성태4/24/200810564.NET : 78. Ajax View
1  2  3  4  5  6  7  8  [9]  10  11  12  13  14  15  ...