Microsoft MVP성태의 닷넷 이야기
Vista : 8. Property System 사용 코드 예 [링크 복사], [링크+제목 복사],
조회: 14513
글쓴 사람
정성태 (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)
134정성태11/15/200510693Microsoft SQL Server Management Studio Express - Community Technical Preview (CTP) November 2005 [1]
242정성태4/19/200611049    답변글 정식 릴리스 - Microsoft SQL Server Management Studio Express
243정성태4/19/200610343    답변글 Microsoft SQL Server 2005 Express Edition Toolkit
245정성태4/19/200610830    답변글 Microsoft SQL Server 2005 Express Edition Service Pack 1
133정성태10/30/200510871VS.NET TS 버전을 제외하고 전부 나왔습니다. ^^
132정성태10/28/200511085IE Script 에서 ADO.Stream 개체를 사용 허가 유무를 지정.
131정성태10/27/200510535ASP.NET Spiced: AJAX
130정성태10/26/200512051RSA In JavaScript [1]파일 다운로드1
128정성태10/25/200510706Connecting to MS SQL Server from Unix파일 다운로드1
129정성태10/25/200510508    답변글 [추가]: SQL Server 2005 JDBC Driver Beta 2 Now Available
173정성태1/20/200610307        답변글 정식 릴리스: Microsoft SQL Server 2005 JDBC Driver
127정성태10/21/20051078764-bit Windows ; 언제, 그리고 왜 써야 할까?
126정성태10/19/200511234WSE(Web Services Enhancements) 3.0의 새로운 기능
125정성태10/14/200511180Cluster 가능한 StateServer 세션 관리자
124정성태10/14/200511294MapPoint Web Service SDK Version 4.0 for Visual Studio .NET 2003
123정성태10/14/200510984alpha release of the Python programming language for the .NET platform
161정성태1/3/200610941    답변글 [추가]: Beta release
184정성태8/12/200611469    답변글 Beta3 까지. ^^
190정성태3/10/200610829    답변글 Beta 4
221정성태3/31/200611040    답변글 Beta 5
246정성태4/21/200610949    답변글 Beta 6
295정성태5/24/200610034    답변글 Beta 7
122정성태10/13/200510818Determine whether service packs are installed on the .NET Framework
121정성태10/12/200510364.NET Reference Guide - 웹
120정성태11/14/200510916VS.NET Automation 과 VSIP
119정성태10/9/200510477Internet Information Services (IIS) 6.0 Resource Kit Tools (English)
... 31  32  33  34  35  36  37  38  39  40  41  [42]  43  44  45  ...