Microsoft MVP성태의 닷넷 이야기
Vista : 8. Property System 사용 코드 예 [링크 복사], [링크+제목 복사],
조회: 11354
글쓴 사람
정성태 (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)
65정성태2/15/200510462Office 2003: XML Reference Schemas
64정성태2/14/200511649MFC 및 ATL 컨트롤을 위한 서명된 CAB 파일 만들기
63정성태2/15/200510168[CodeProject] Overriding MFC's Default Client Site to Implement IServiceProvider파일 다운로드1
62정성태11/14/200510524간략 소개 - 64bit Windows
61정성태1/29/200510613XP SP2 팝업창을 코드로 띄우는 것이 가능하군요.
60정성태1/28/20058959MSDN Chat : VS.NET 2005 Team System public chats파일 다운로드1
59정성태1/27/200511097Error 1034. Error writing to file" when installing Visual Studio .NET 2005 CTP December 2004 - error code is 2350
57정성태1/17/200510404Microsoft .NET: Implement a Custom Common Language Runtime Host for Your Managed App파일 다운로드1
56정성태1/12/200510776.NET Framework 2.0 설치 후, InfoPath 폼이 VS.NET 2003 에서 디버깅이 안되는 경우.
55정성태1/10/200510908Management (WMI) Extensions for Visual Studio .NET 2003 Server Explorer
54정성태1/11/200510128WSE 2.0 및 Sun JWSDP 1.4를 사용한 WS-Security 상호 운용성
76정성태3/10/200510582    답변글 [추가]: Web Services Security Interoperability using WSE 2.0 and Systinet Server 5.0 for Java
94정성태5/12/200510368    답변글 [추가]: JWSDP 1.5 버전이 나왔군요.
148정성태12/12/20058673    답변글 [추가]: WS-Security Interoperability with .NET/WSE and WebLogic Workshop 8.1파일 다운로드1
53정성태1/6/200510994버퍼 오버런 해결!
58정성태1/23/200511742    답변글 VS.NET 2005 : 새롭게 소개되는 버퍼 오버런 방지 CRT 함수들
52정성태1/6/20059883Visual C# .NET Code Samples
51정성태1/6/200510001Visual C++ .NET 2003 Code Samples
50정성태1/6/200510041Visual Studio .NET 2003 Automation Samples
49정성태1/3/200598942005년 올 한 해 릴리스 될 MS 제품
48정성태1/2/200510194.NET 2.0 : 연결 문자열 및 기타 .config 내용 암호화
47정성태12/31/200410379뉴스그룹: Microsoft Whidbey Private 뉴스 그룹
46정성태12/31/200410144MSDN Magazine: Comparing the Timer Classes in the .NET Framework Class Library
45정성태12/31/20049665MSDN Magazine: Updating the UI from a Secondary Thread
44정성태12/30/200410816NewSID : 사용자 계정의 보안 식별자를 변경해 주는 프로그램파일 다운로드1
43정성태12/28/200410136VSMT 소개: Physical Server to Virtual Server
... 31  32  33  34  35  36  37  38  39  40  41  42  43  44  [45]  ...