Microsoft MVP성태의 닷넷 이야기
Vista : 8. Property System 사용 코드 예 [링크 복사], [링크+제목 복사],
조회: 11356
글쓴 사람
정성태 (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)
322정성태6/17/200610054TFS : 6. TFS 데이터베이스 백업파일 다운로드1
321정성태6/16/200610258TFS : 5. Team Build 유형 삭제 방법파일 다운로드1
320정성태6/16/200610635TFS : 4. TFS 접근에 대한 SSL 관련 설정파일 다운로드1
319정성태6/16/200610902TFS : 3. TFS 에서의 "Check Out" 과 기존 SourceSafe 에서의 "Check Out" 기능 차이
318정성태6/16/200611186TFS : 2. TFS 에서의 Label 과 기존 SourceSafe 에서의 Label 기능 차이파일 다운로드1
317정성태6/17/20069802VS.NET IDE : 5. VC++ - 디버거 상태에서 값을 보여주는 형태를 사용자 정의파일 다운로드1
316정성태6/16/20068473VS.NET IDE : 4. Microsoft Visual Studio Team Edition for Software Developers파일 다운로드1
315정성태6/16/20069850.NET : 2. Gmail 서버를 이용해서 SmtpClient 로 메일 보내기파일 다운로드1
314정성태6/16/20068927VS.NET IDE : 3. Validation (XHTML 1.0 Transitional): Attribute '...' is considered outdated. A newer construct is recommended.파일 다운로드1
313정성태6/15/20069060IIS - 2. Adding OpenSearch for your CommunityServer Site
312정성태6/16/20069132TFS : 1. TeamBuild and VC++ overrides [1]
311정성태6/14/20069418IIS - 1. Changes to compression in IIS7
310정성태6/16/20068827개발환경 구성 : 1. Windows 2003 + .NET Framework 고성능 애플리케이션 구축파일 다운로드1
309정성태6/11/200611110기타 : 1. [Outlook] EXE 첨부파일 해제하는 방법
308정성태6/8/20068788.NET : 1. 웹 서비스 - 압축 SoapExtension파일 다운로드1
306정성태6/7/20069460SDK : 2. Delta Compression Application Programming Interfaces
304정성태6/2/20069131SDK : 1. CS_OWNDC 상세 설명
305정성태6/3/20069617    답변글 SDK : 2. CS_CLASSDC 상세 설명
303정성태6/2/20068796VS.NET IDE : 2. LINQ May CTP 를 설치하는 경우, C# 편집기에서 Smart Tag 동작하지 않는 문제
302정성태6/2/20068922VS.NET IDE : 1. Atlas (CTP) 컨트롤 - 툴박스에 추가
301정성태5/31/200611096IronPython 강좌
300정성태5/29/20069082Phoenix RDK 5월판
299정성태5/28/20069801Visual C++ 2005 IDE Enhancements Part 1 ~ 5
298정성태5/28/20069640IE7+ 라는 새로운 이름
297정성태5/27/20069926TRX2HTML
296정성태5/27/20069413WWF 로 만든 Tetris
... 31  32  33  34  [35]  36  37  38  39  40  41  42  43  44  45  ...