Sign in
The Great Flying Tortoise
A hard-boiled look at Win32 C++ programming and the property system
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
About
Email Blog Author
RSS for posts
Atom
RSS for comments
OK
Search
Tags
.NET
General
indexing
Property Handlers
Property System
reading properties
Tagging
troubleshooting
World of Warcraft
writing properties
Archive
Archives
July 2007
(1)
May 2007
(1)
January 2007
(11)
November 2006
(11)
October 2006
(13)
September 2006
(17)
August 2006
(4)
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
The Great Flying Tortoise
Property System Layers and Extensibility Points
Posted
over 7 years ago
by
benkaras
4
Comments
It's easy to get confused about what points of extensibility exist and what layer provide what services. This isn't helped by the fact that we've lumped a bunch of things into the property system, but I'll try to diagram this out here and in future posts...
The Great Flying Tortoise
Coding to the Windows SDK
Posted
over 7 years ago
by
benkaras
3
Comments
In the near future I'll be posting code examples that compile and run. In case you'd like to follow along, here's my personal setup. My code should compile on RC1 also, so go ahead and use RC1 if that's what you can get a hold of. Windows Vista...
The Great Flying Tortoise
Properties coding expedition #1 - Binding to an item
Posted
over 7 years ago
by
benkaras
3
Comments
The goal of this first expedition is to print lists of properties from items. This will give insight into the origins and capabilities of these different properties. Feel free to follow along and try out different things. There's a lot to explore. ...
The Great Flying Tortoise
PROPVARIANT helpers #1 - Initialization
Posted
over 7 years ago
by
benkaras
2
Comments
PROPVARIANTs are easy to misuse . Because the data members are so cryptic, it is easy to get confused or to overlook errors. To help alleviate these and other problems (including readability), we provide a series of PROPVARIANT helpers for common uses...
The Great Flying Tortoise
What is the Property System? - in normal language
Posted
over 7 years ago
by
benkaras
2
Comments
In my first post , I described what the property system provides from an API perspective. But I used all these techno-wiggle-waggle-jibber-jabber that my friends couldn't follow. Ich. What feedback for a first post! So here it is minus the 133t-speak...
The Great Flying Tortoise
Property consumerism
Posted
over 7 years ago
by
benkaras
2
Comments
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...
The Great Flying Tortoise
PROPVARIANT Helpers #6 - PropVariantCompare[Ex]
Posted
over 7 years ago
by
benkaras
2
Comments
In general, PropVariantCompare performs a locale-sensitive comparison between two values and returns <0, 0, or >0 as appropriate. PropVariantCompare always tries to convert the values to the type of the first value. Thus if code tries to compare...
The Great Flying Tortoise
Properties coding expedition #7 - The final output
Posted
over 7 years ago
by
benkaras
2
Comments
This coding expedition has developed a tool that can dump out all the properties on a file. If you are curious about the property system, I highly recommend you build this tool and run it on various file types. Coding to the Windows SDK Part 1 ...
The Great Flying Tortoise
Writing properties #1 - Simple beginnings
Posted
over 7 years ago
by
benkaras
2
Comments
I'm going to be talking about writable properties over the next few days. I know that some of you are itching to try this out yourselves, so here is an overly simplistic program that will write a single property to a file. I have omitted a lot of diagnostic...
The Great Flying Tortoise
PROPVARIANT Helpers #4 - Vector Helpers
Posted
over 7 years ago
by
benkaras
1
Comments
One of the more prominent properties is PKEY_Keywords , e.g. "Tags". This is a vector property, and so it usually comes packaged in a PROPVARIANT with VT_VECTOR|VT_LPWSTR . If you deal with properties such as this, you may find the following helpers useful...
The Great Flying Tortoise
PROPVARIANT Helpers #7 - Locale sensitivity and the helper APIs
Posted
over 7 years ago
by
benkaras
1
Comments
As I went through the property helper posts, I kept using those dense word combinations " locale sensitive " and " locale insensitive ". Why? Because locale tells your computer whether to display a number as "5.3" or "5,3". Should "5,305" be a big...
The Great Flying Tortoise
Writing properties #5 - Property lists
Posted
over 7 years ago
by
benkaras
1
Comments
So if a property handler doesn't enumerate which properties it supports writing , then how does the explorer pick which properties to show? Well, the shell namespace extension containing the item specifies the list of properties it wants to show in a...
The Great Flying Tortoise
Writing properties #6 - GPS_READWRITE omits read-only data sources
Posted
over 7 years ago
by
benkaras
1
Comments
You'll recall that there are multiple layers in the property system . In particular, the GPS_DEFAULT property system stack for files in the filesystem namespace looks like this: [ Application using GPS_DEFAULT ] [ Coercion Layer ] [ Shell Item Layer...
The Great Flying Tortoise
Writing properties #7 - IPropertyStoreCapabilities requires GPS_READWRITE
Posted
over 7 years ago
by
benkaras
1
Comments
[Edit: 2006/11/13 - My original post got this topic entirely backwards. I've fixed the title and will provide details about this tomorrow. ] -Ben Karas
The Great Flying Tortoise
Trying out the property system
Posted
over 7 years ago
by
benkaras
1
Comments
You can, of course, wait for Windows Vista to ship before checking out the property system. But if you are curious or bored, here are a few other things you might do: Download the Windows Vista Platform SDK: The most recent Platform SDK . The SDK...
The Great Flying Tortoise
What is the property system?
Posted
over 7 years ago
by
benkaras
1
Comments
The property system is a new set of APIs for Microsoft Windows Vista that provides a general way to access metadata about files and items accessible through the shell namespace. This means you can ask for the dimensions of an image, or the size of a file...
The Great Flying Tortoise
Canonical Property Names
Posted
over 7 years ago
by
benkaras
1
Comments
Most of the property system uses PROPERTYKEY s to identify properties. But you can also identify a property using its canonical name. For instance, PKEY_DateModified corresponds to L"System.DateModified". Whereas a PROPERTYKEY was good for coding and...
The Great Flying Tortoise
The source of property types
Posted
over 7 years ago
by
benkaras
1
Comments
I mentioned that one of the property system layers coerces values to be of the correct type. But how does the system know the expected type? The property system maintains a data structure describing each property on the machine. Each property description...
The Great Flying Tortoise
Properties coding expedition #2 - printing the IPropertyStore
Posted
over 7 years ago
by
benkaras
1
Comments
Last time we saw how to bind to a shell item and get its property store. Today, we loop through the store printing out known properties. HRESULT _PrintPropertyStore(IPropertyStore *pps) { DWORD cProps; HRESULT hr = pps-> GetCount (&cProps...
The Great Flying Tortoise
Properties coding expedition #3 - Printing a value
Posted
over 7 years ago
by
benkaras
1
Comments
In parts one and two , I started writing a program to print out the properties on an item. But I saved the best for last -- printing a value. Discussion follows the code. HRESULT _PrintPropertyValue(__in REFPROPERTYKEY key, __in REFPROPVARIANT propvar...
The Great Flying Tortoise
Properties coding expedition #4 - The output
Posted
over 7 years ago
by
benkaras
1
Comments
The program itself is provided in parts 1 , 2 , and 3 . So I compiled my program and ran it from the command line. Here's a snippet of what I got back: Properties for 'scan0010.jpg' Folder name: propshow Type: JPEG Image Name: scan0010.jpg Size: 638...
The Great Flying Tortoise
Properties coding expedition #5 - Stripping characters
Posted
over 7 years ago
by
benkaras
1
Comments
In Part 4 , I discovered that WideCharToMultiByte converts certain invisible non-spacing Unicode characters to ?. This makes the output look really silly in a command line application. I want to keep this as a command line application, so I need to strip...
The Great Flying Tortoise
Properties coding expedition #6 - Developer friendly output
Posted
over 7 years ago
by
benkaras
1
Comments
Using the tool I developed in this series, I know that my test photo has " Rating: 5 Stars ". But how is this value actually represented in the JPG itself? Let's answer that by adding some developer friendly output. Here's what I did: First, I need...
The Great Flying Tortoise
Introducing the PROPVARIANT
Posted
over 7 years ago
by
benkaras
0
Comments
Values in the property system are stored in PROPVARIANT structures. Originally constructed for use in OLE structured storage, the property system reuses this structure to hold its data. As the name suggests, a PROPVARIANT can hold a variety of data...
The Great Flying Tortoise
PROPVARIANTs - Common mistakes
Posted
over 7 years ago
by
benkaras
0
Comments
As I mentioned yesterday, PROPVARIANT's hold data that gets piped through the property system. Early in our development cycle, we noticed is that even the most careful developer can easily make mistakes when initializing PROPVARIANTs. One common...
Page 1 of 2 (36 items)
1
2