Custom list items in SubItemControl (sicDropList)

The place for threads about TimoSoft ExplorerListView.
Post Reply
Cube8
Lieutenant
Posts: 12
Joined: 15 Aug 2015, 15:56
Location: Thessaloniki, Greece

Custom list items in SubItemControl (sicDropList)

Post by Cube8 » 25 Oct 2015, 19:19

I want to use a drop list custom subitem control with items provided by me.
In your code samples, there is a note: "With some more effort, you could provide custom implementations of the IPropertyDescription interface"
I searched MSDN and found that IPropertyDescription has to do with "listitems" provided by the system.
So, as far as I understand, I must first add my custom entries into some place in the system and then use IProperyDescription.
However, I couldn't figure out how to do that. It seems too complicated for such a simple task...
Basically, I found out that the "system lists" are read-only and I couldn't find a function to create a custom list.

Is this the only way to do it?

User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: Unterföhring
Contact:

Re: Custom list items in SubItemControl (sicDropList)

Post by TiKu » 25 Oct 2015, 23:43

Actually you would need to provide a COM object that implements the IPropertyDescription interface and provides your custom items. I never actually tried this approach, because implementing IPropertyDescription is quite some effort. But it should work.

So, to start with, in VB6 you would need a TLB that provides the definition of IPropertyDescription. Add this tlb file to your project, add a class and in this class you add "Implements IPropertyDescription."
In C++ it would be a bit easier.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!

Cube8
Lieutenant
Posts: 12
Joined: 15 Aug 2015, 15:56
Location: Thessaloniki, Greece

Re: Custom list items in SubItemControl (sicDropList)

Post by Cube8 » 26 Oct 2015, 11:17

Reading the MSDN documentation more thoroughly, I discovered that, in order to use a custom list, I will have to register a custom property schema in the system.
Unfortunately, this doesn't fit my needs, because: (1) the list of values will be dynamic and (consequently, 2), since my app runs without admin rights, I can't follow this approach.

Anyway, I'll create another GUI (combobox) for my custom list.

User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: Unterföhring
Contact:

Re: Custom list items in SubItemControl (sicDropList)

Post by TiKu » 26 Oct 2015, 13:49

I don't think it would be necessary to register a custom property schema, but I might be wrong.
The ConfigureSubItemControl event has a ByRef pPropertyDescription parameter, which can be changed to your own implementation of IPropertyDescription. IPropertyDescription has a method GetEnumTypeList which seems like it can be used to provide a list of possible items to the system.
Okay, I don't know which of the interface's methods have to be implemented and which of them can return E_NOTIMPL. Maybe you would have to implement GetPropertyKey and maybe you would not get away with some fake property key that never has been registered as part of a property schema.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!

Cube8
Lieutenant
Posts: 12
Joined: 15 Aug 2015, 15:56
Location: Thessaloniki, Greece

Re: Custom list items in SubItemControl (sicDropList)

Post by Cube8 » 26 Oct 2015, 18:23

I don't understand. How am I supposed to provide my own implementation of the interface? The documentation says explicitly to not implement it because it is provided by the shell. Unless you mean to create a VB class with the same methods and parameters and pass an ObjPtr as the pPropertyDescription param. It still seems complicated.

The MSDN article I was talking about:
Understanding the Property Description Schema

User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: Unterföhring
Contact:

Re: Custom list items in SubItemControl (sicDropList)

Post by TiKu » 26 Oct 2015, 19:54

Well, this whole feature is not documented by Microsoft. Of course they tell us to not implement IPropertyDescription.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!

Post Reply