Microsoft MVP성태의 닷넷 이야기
Vista : 8. Property System 사용 코드 예 [링크 복사], [링크+제목 복사],
조회: 11394
글쓴 사람
정성태 (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)
525정성태11/14/200610443Vista : 14. .NET 개발자들을 위한 Vista 기능 소개
524정성태11/13/20069970TFS : 55. Annotate 소개
523정성태11/13/200611548.NET 3.0 : 7. WPF - EXE 유형의 프로젝트를 XBAP 유형으로 변경
522정성태11/12/200611101.NET : 33. SynchronizationContext 에 대해서.
521정성태11/12/20069708SDK : 7. Sessions, Window Stations, Desktops
520정성태11/12/200611245Vista : 13. LLTD(Link Layer Topology Discovery)가 뭘까요?
519정성태11/12/20069710Vista : 12. Network Location Type - Public, Private, Domain - 에 대한 설명.
518정성태11/12/20069529개발 환경 구성: 53. Sandcastle - 일반적인 HTML 파일 이름 생성
517정성태11/11/200610323.NET : 32. Enterprise Library - 예외 처리 가이드 (PPT 및 소스 코드) [2]파일 다운로드1
516정성태11/10/20069215개발 환경 구성: 52. Vista - 원격 터미널 클라이언트에서 다중 모니터 지원
515정성태11/8/200610186SDK : 6. 패치 툴 소개 ( mspatcha, mspatchc )파일 다운로드1
514정성태11/8/20069950.NET : 31. MSN Messenger 연동 라이브러리
513정성태11/8/200611369Visual C++ : 5. Browser Helper Object 제작 방법
512정성태11/8/200611548SDK : 5. Tiny PE - 가장 작은 PE 파일 제작파일 다운로드1
511정성태11/8/200610612개발 환경 구성: 51. Extended Validation (EV) SSL 인증서 소식 [1]
510정성태11/7/200610364VS.NET IDE : 13. Guidance Automation Toolkit and Domain-Specific Language Tools for Visual Studio 2005: Integration Scenarios
509정성태11/7/20069890.NET 3.0 : 6. ADO.NET Samples for Visual Studio Code Name “Orcas” - October CTP
508정성태11/6/20069682TFS : 54. 새로운 TFS 리포트 생성
507정성태11/5/20069478.NET : 30. LINQ 관련 자료
506정성태11/5/20069771.NET : 29. .NET Fusion API
505정성태11/4/20069585.NET : 28. The .NET Developer's Guide to Identity
504정성태11/4/20069786.NET : 27. ASP.NET 2.0 Resource-Provider 모델 확장
503정성태11/4/20069767TFS : 53. VSTS 관련 자료 링크 모음
502정성태11/4/20069538TFS : 52. Data-Tier Server 미러링
501정성태11/3/20069753TFS : 51. TFS 증분 빌드 환경 설정
500정성태11/2/20069618TFS : 50. TfsAlert 0.3.0.0 릴리스
... 16  17  18  19  20  21  22  23  24  25  26  [27]  28  29  30  ...