Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Creating mini-icons

2 views
Skip to first unread message

Jim Moe

unread,
Nov 13, 2009, 10:32:53 PM11/13/09
to
Hello,
This is related to the topic "How do icons work?". It is a more specific
question.
The story so far: It is not possible to create mini icons by loading an
icon file (FILE.ICO), converting the bitmap data to an image, and passing
those images to WinCreatePointer() or WinCreatePointerIndirect(). Both API
functions either take a full icon and shrink it, or expand a mini icon
image to full size and then shrink that.
There is clearly *some* way to do this. For instance, the details view
of a directory properly shows the mini icon of an icon file listing.

The WPS reference lists two potentially useful functions, wpSetIcon()
and wpSetIconData(). I know next to nothing about WPS programming.
Is it possible to get the "WPObject*" value of a field in a details view
container? Is there such a thing?

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)

Marcel Müller

unread,
Nov 14, 2009, 5:02:28 AM11/14/09
to
Hi,

Jim Moe wrote:
> The story so far: It is not possible to create mini icons by loading an
> icon file (FILE.ICO), converting the bitmap data to an image, and passing
> those images to WinCreatePointer() or WinCreatePointerIndirect(). Both API
> functions either take a full icon and shrink it, or expand a mini icon
> image to full size and then shrink that.
> There is clearly *some* way to do this. For instance, the details view
> of a directory properly shows the mini icon of an icon file listing.

I had a similar problem in PM123 some time ago when I tried to use small
icons without the additional +/- icons in the container control. As far
I remember I got a hint about an undocumented flag. You might have a
look to the playlistmanager source code of PM123 1.40a4. Maybe it points
you in the right direction. At least the container view is solved there.

For the pointers: once you have a mini icon as bitmap data you might pad
it with masked pixels to get a larger pointer and keep the API happy if
nothing else helps.


Marcel

Jim Moe

unread,
Nov 14, 2009, 3:19:33 PM11/14/09
to
On 11/14/09 03:02 am, Marcel M�ller wrote:
>> There is clearly *some* way to do this. For instance, the details view
>> of a directory properly shows the mini icon of an icon file listing.
>
> I had a similar problem in PM123 some time ago when I tried to use small
> icons without the additional +/- icons in the container control. As far
> I remember I got a hint about an undocumented flag. You might have a
> look to the playlistmanager source code of PM123 1.40a4. Maybe it points
> you in the right direction. At least the container view is solved there.
>
Could you be more specific? I did not find any place where you loaded an
icon file and created a mini icon from it.

> For the pointers: once you have a mini icon as bitmap data you might pad
> it with masked pixels to get a larger pointer and keep the API happy if
> nothing else helps.
>

Hmm. Interesting hack...

Marcel Müller

unread,
Nov 14, 2009, 5:48:59 PM11/14/09
to
Jim Moe wrote:
> On 11/14/09 03:02 am, Marcel M�ller wrote:
>>> There is clearly *some* way to do this. For instance, the details view
>>> of a directory properly shows the mini icon of an icon file listing.
>> I had a similar problem in PM123 some time ago when I tried to use small
>> icons without the additional +/- icons in the container control. As far
>> I remember I got a hint about an undocumented flag. You might have a
>> look to the playlistmanager source code of PM123 1.40a4. Maybe it points
>> you in the right direction. At least the container view is solved there.
>>
> Could you be more specific? I did not find any place where you loaded an
> icon file and created a mini icon from it.

I load it from a linked resource. But this should not make a major
difference. Maybe it is in the base class PlaylistBase, since the icons
are the same than in the detailed view. (I currently have no access to
the OS/2 machine.)
The container options should be set either in the Init function or in
the resource file. I think CCS_MINIICONS did the trick.


Marcel

Jim Moe

unread,
Nov 14, 2009, 8:27:56 PM11/14/09
to
On 11/14/09 03:48 pm, Marcel M�ller wrote:
>>>
>> Could you be more specific? I did not find any place where you loaded an
>> icon file and created a mini icon from it.
>
> I load it from a linked resource. But this should not make a major
> difference. Maybe it is in the base class PlaylistBase, since the icons
> are the same than in the detailed view.
>
Ah. Loading from a DLL or EXE where the icons are added at link time
works as expected. It is creating a mini icon at runtime from an icon file
is where the problem exists.

> The container options should be set either in the Init function or in
> the resource file. I think CCS_MINIICONS did the trick.
>

Already there.

0 new messages