Microsoft MVP성태의 닷넷 이야기
Vista : 8. Property System 사용 코드 예 [링크 복사], [링크+제목 복사],
조회: 17062
글쓴 사람
정성태 (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)
269정성태5/4/200614921Visual Studio 2005 Team System Level 200 Course Material
268정성태5/4/200615310Microsoft Component Installer Software Development Kit for Windows (x86) Version 2.0
267정성태5/4/200615391101 Code Samples for Visual Basic 2005
266정성태5/3/200617467Consolas Font Pack for Microsoft Visual Studio 2006 [2]
264정성태5/1/200617086Team System for C++ Developers
262정성태5/1/200627380Registry 등록 없이 COM 개체 사용 [1]파일 다운로드2
261정성태4/30/2006167874GB 메모리 인식 [2]
259정성태4/30/200615367Building ASP.NET 2.0 Web Sites Using Web Standards
260정성태4/30/200614731    답변글 XHTML Validator Modulle
258정성태4/29/200615198WebServiceStudio 2.0
263정성태5/1/200614634    답변글 Calling an Arbitrary Web Service
257정성태4/29/200614605TypeForwardedToAttribute
256정성태4/29/200614852Windows API - Using Condition Variables
252정성태4/26/200614381한글 관련 메세지 정리파일 다운로드1
251정성태4/26/200615221IIS 7.0 에서 소개되는 새로운 기능들 [1]
250정성태4/25/200615698툴 소개: VisualNDepend
249정성태4/25/200621671Integrating a debugger into Reflector
265정성태5/1/200615996    답변글 Deblector: First Version
285정성태5/15/200613983    답변글 New Deblector version ( an Add-In to debug with reflector )
248정성태4/21/200614271VS.NET 2005 Add-In : CSS Properties Window
247정성태4/21/200614159VS.NET 2005 Add-In : Spell Checker for HTML and ASP.NET pages
244정성태4/19/200613967SQL Server 2005 Service Pack 1
241정성태4/19/200613484VSTS Annotations for C++: Beyond Just Documenting Method Behavior [1]파일 다운로드1
240정성태4/18/200614129Accessing System Power and Network Status Using SENS
253정성태4/29/200614259    답변글 [HowToUse]: Accessing System Power and Network Status Using SENS
239정성태4/18/200613908Display a Web Page in a Plain C Win32 Application
... 31  32  33  34  35  36  [37]  38  39  40  41  42  43  44  45  ...