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

... 46  [47] 
NoWriterDateCnt.TitleFile(s)
18정성태9/19/200410004HTML SELECT 요소에 OPTION 요소를 채우는 C/C++ 예제파일 다운로드1
17정성태11/14/20059048[정보] Visual Studio 6.0 Samples
16정성태9/5/200410160JAVA 로 구현된 NTLM 구현파일 다운로드1
15정성태9/2/20048798Developing Active Server Components with ATL
14정성태7/20/20049021No-Touch Deployment
13정성태6/30/20049289How to read BLOB from Dataset into buffer?
11정성태2/14/20049181XMLHTTP 에서 반환받은 non-XML 데이터를 보여주는 모듈
10정성태2/14/200411908MSIL 디컴파일러 - .NET Reflector [1]
9정성태1/26/200410437스크립트 디코더파일 다운로드1
159정성태12/23/20058020    답변글 [업데이트]: 스크립트 디코더파일 다운로드1
8정성태1/26/200413023게시물 도배 프로그램 방지
7정성태1/26/200411136Microsoft.XMLHTTP 개체로 XML 이 아닌 다른 데이터 가져오기
6정성태8/6/200310316Three Ways to Inject Your Code into Another Process파일 다운로드1
5정성태7/29/200310255SQL 서버 sa 암호를 잊은 경우, 복구하는 방법파일 다운로드1
4정성태7/25/200311714DiskId32 - 물리하드 디스크 정보파일 다운로드2
12정성태6/11/20048935    답변글 [추가] WMI 로 구하는 방법파일 다운로드1
3정성태7/25/200310471C# 프로그래밍 언어에 추후 추가되는 기능파일 다운로드1
2정성태7/25/200310647INFO: COM+ 1.0의 새로운 기능파일 다운로드1
... 46  [47]