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

... 31  32  33  [34]  35  36  37  38  39  40  41  42  43  44  45  ...
NoWriterDateCnt.TitleFile(s)
346정성태6/29/20069211Debug : 1. How to build Mdbg apps파일 다운로드1
344정성태10/20/200611796Vista : 3. Vista에서 제거되는 DHTML Editing Control - 두 번째 소식
345정성태10/20/200610514    답변글 Vista : 3.1 [현상 1] Vista 에서 OWA 접근
351정성태10/20/200613798    답변글 Vista : 3.2 Vista에서 문제되는 웹 사이트
352정성태10/20/200611021    답변글 Vista : 3.3 Vista 관련 조각 코드파일 다운로드1
343정성태6/26/20069659TFS : 10. TFS Bug Snapper v1.0 Released
342정성태6/26/20069063TFS : 9. TFS Notification Web Services - Project Template 1.1 available
341정성태6/25/20069459.NET : 7. VCPROJ - Shared Source Common Language Infrastructure 2.0 Release파일 다운로드1
340정성태6/25/20068744개발환경 구성 : 7. XSLT on the fly.
339정성태6/25/20069211.NET : 6. 무료 - ByesRoad.NetSuit Library
337정성태10/20/200613395Vista : 2. Credential Provider Samples파일 다운로드1
336정성태6/23/20068801.NET : 5. BLINQ using LINQ
335정성태6/23/20069458개발환경 구성 : 6. MSBuild or Team Build Tasks in the Community
334정성태6/26/20068924TFS : 8. Customizing MSF Process Guidance
333정성태6/21/20069214VS.NET IDE : 6. The Visual Studio Hosting Process - VSHost.exe
332정성태6/21/20069248TFS : 7. Team Foundation Power Toys
331정성태6/21/20068998Debug: CardSpaces Crash 를 해결해 가는 디버깅 과정
330정성태10/20/200610328Vista : 1. New API - 스레드 대기 상태를 확인하는 방법 제공
329정성태6/21/20069125.NET : 4. Tech-Ed 2006 - WebCast 자료
328정성태6/23/20069801개발환경 구성 : 5. Robocopy GUI
327정성태6/18/200610448.NET : 3. Open XML을 다루는 코드 스니핏 [1]
326정성태6/18/20069615개발환경 구성 : 4. COM+ 서비스에서 인증서 사용.
325정성태6/17/20069482STL.NET
324정성태6/17/20069266개발환경 구성 : 3. Signed versions of the power toys available on MS Downloads
323정성태6/17/20069595개발환경 구성 : 2. the sandbox projects
322정성태6/17/200610054TFS : 6. TFS 데이터베이스 백업파일 다운로드1
... 31  32  33  [34]  35  36  37  38  39  40  41  42  43  44  45  ...