|
|
|
date: Fri, 29 Feb 2008 04:37:00 -0800,
group: microsoft.public.platformsdk.shell
back
Re: Shell32.dll icons
Dan,
You are probably getting mixed answers because you are asking mixed or
unclear questions. I'll just try to answer a bunch of questions and you go
ahead and pick one :)
You can't just use any icon resource you want in Shell32.dll, because the
resource IDs could change or an icon could be removed in any build. However,
people do it and so Microsoft probably tries to minimize that.
You can use SHGetFileInfo, or make use of shell interfaces, to get an HICON
or image list handle and icon index to any object in Explorer (a file, file
type, folder, virtual folder, virtual item) which could be from Shell32.dll,
another system DLL or any other file.
Some icons used commonly by the shell are actually in ComCtl32.dll, and can
be loaded by sending a TB_LOADIMAGES message to a toolbar.
I use Delphi myself, and I sometimes find it convenient to copy these images
to a TImageList. Let me know which icons you are looking for and I will help
you with the code.
Paul
"Dan Kelly" wrote in message
news:0D7753B2-148E-45A9-9EB0-A5E3EA8C2FBC@microsoft.com...
> Hi
>
> I am using Delphi to develop applications for Windows XP and wondering
> about
> using the standard icons from Shell32.dll on my toolbar.
>
> I've been trying to track down the usage rights fror these icons and
> getting
> mixed messages.
>
> Basically:
>
> 1) Can I use the icons from Shell32.dll in my application?
>
> If so can I :
>
> 2) Extract the images to load the ones I want into a Delphi TImagelist?
>
> or
>
> 3) Do I have to load the full Shell32.dll list using the API calls?
>
> Finally
>
> 4) Can I base my icons on the standard icons if there are any missing?
>
> Cheers
>
> Dan
date: Fri, 29 Feb 2008 09:25:16 -0500
author: Paul Baker [MVP, Windows - SDK] am
Re: Shell32.dll icons
Thanks Paul,
The nub of the question is really:
"Am I allowed to?"
The icons I'm looking to use in my toolbar are the standard Undo, Delete,
Open and New icons...
Cheers
"Paul Baker [MVP, Windows - SDK]" wrote:
> Dan,
>
> You are probably getting mixed answers because you are asking mixed or
> unclear questions. I'll just try to answer a bunch of questions and you go
> ahead and pick one :)
>
> You can't just use any icon resource you want in Shell32.dll, because the
> resource IDs could change or an icon could be removed in any build. However,
> people do it and so Microsoft probably tries to minimize that.
>
> You can use SHGetFileInfo, or make use of shell interfaces, to get an HICON
> or image list handle and icon index to any object in Explorer (a file, file
> type, folder, virtual folder, virtual item) which could be from Shell32.dll,
> another system DLL or any other file.
>
> Some icons used commonly by the shell are actually in ComCtl32.dll, and can
> be loaded by sending a TB_LOADIMAGES message to a toolbar.
>
> I use Delphi myself, and I sometimes find it convenient to copy these images
> to a TImageList. Let me know which icons you are looking for and I will help
> you with the code.
>
> Paul
>
> "Dan Kelly" wrote in message
> news:0D7753B2-148E-45A9-9EB0-A5E3EA8C2FBC@microsoft.com...
> > Hi
> >
> > I am using Delphi to develop applications for Windows XP and wondering
> > about
> > using the standard icons from Shell32.dll on my toolbar.
> >
> > I've been trying to track down the usage rights fror these icons and
> > getting
> > mixed messages.
> >
> > Basically:
> >
> > 1) Can I use the icons from Shell32.dll in my application?
> >
> > If so can I :
> >
> > 2) Extract the images to load the ones I want into a Delphi TImagelist?
> >
> > or
> >
> > 3) Do I have to load the full Shell32.dll list using the API calls?
> >
> > Finally
> >
> > 4) Can I base my icons on the standard icons if there are any missing?
> >
> > Cheers
> >
> > Dan
>
>
>
date: Fri, 29 Feb 2008 06:40:00 -0800
author: Dan Kelly
Re: Shell32.dll icons
Dave,
Doesn't Visual Studio just use the ones that come with Windows? Anyway, Dan
is using Delphi.
Dan,
You want to use TB_LOADIMAGES like this:
ToolBar:= TToolBar.CreateParented(Application.Handle);
try
ToolBar.Images:= MyImageList;
ToolBar.Perform(TB_LOADIMAGES, MyBitmapID, LPARAM(HINST_COMMCTRL));
finally
ToolBar.Free;
end;
MyImageList is your TImageList.
MyBitmapID would be IDB_STD_LARGE_COLOR or IDB_STD_SMALL_COLOR.
Your image indexes would be STD_UNDO, STD_DELETE, STD_FILEOPEN and
STD_FILENEW.
TB_LOADIMAGES Message:
http://msdn2.microsoft.com/en-us/library/bb787381(VS.85).aspx
Toolbar Standard Button Image Index Values:
http://msdn2.microsoft.com/en-us/library/bb760433(VS.85).aspx
Paul
"David Lowndes" <DavidL@example.invalid> wrote in message
news:u7ags3pt34t09c2jkiubb40s9dkag9nnks@4ax.com...
> >The nub of the question is really:
>>
>>"Am I allowed to?"
>>
>>The icons I'm looking to use in my toolbar are the standard Undo, Delete,
>>Open and New icons...
>
> MS ship a load of freely usable images in Visual Studio. If you have a
> VS license you could presumably use those.
>
> Dave
date: Fri, 29 Feb 2008 12:23:17 -0500
author: Paul Baker [MVP, Windows - SDK] am
Re: Shell32.dll icons
Paul,
That looks great - will try it out over the weekend.
I take it from the above that MS have no problem with the STD_* images being
used in commercial apps?
"Paul Baker [MVP, Windows - SDK]" wrote:
> Dave,
>
> Doesn't Visual Studio just use the ones that come with Windows? Anyway, Dan
> is using Delphi.
>
> Dan,
>
> You want to use TB_LOADIMAGES like this:
>
> ToolBar:= TToolBar.CreateParented(Application.Handle);
> try
> ToolBar.Images:= MyImageList;
> ToolBar.Perform(TB_LOADIMAGES, MyBitmapID, LPARAM(HINST_COMMCTRL));
> finally
> ToolBar.Free;
> end;
>
> MyImageList is your TImageList.
>
> MyBitmapID would be IDB_STD_LARGE_COLOR or IDB_STD_SMALL_COLOR.
>
> Your image indexes would be STD_UNDO, STD_DELETE, STD_FILEOPEN and
> STD_FILENEW.
>
> TB_LOADIMAGES Message:
> http://msdn2.microsoft.com/en-us/library/bb787381(VS.85).aspx
>
> Toolbar Standard Button Image Index Values:
> http://msdn2.microsoft.com/en-us/library/bb760433(VS.85).aspx
>
> Paul
>
> "David Lowndes" <DavidL@example.invalid> wrote in message
> news:u7ags3pt34t09c2jkiubb40s9dkag9nnks@4ax.com...
> > >The nub of the question is really:
> >>
> >>"Am I allowed to?"
> >>
> >>The icons I'm looking to use in my toolbar are the standard Undo, Delete,
> >>Open and New icons...
> >
> > MS ship a load of freely usable images in Visual Studio. If you have a
> > VS license you could presumably use those.
> >
> > Dave
>
>
>
date: Fri, 29 Feb 2008 09:33:02 -0800
author: Dan Kelly
Re: Shell32.dll icons
Dan,
Um... if they do they should have said so in the documentation. It looks
like this message was designed for the very purpose you intend it to.
Microsoft wants to encourage consistency of certain UI elements, I think.
Paul
"Dan Kelly" wrote in message
news:81D97B37-123E-4B09-9116-6D033DC86DE4@microsoft.com...
> Paul,
>
> That looks great - will try it out over the weekend.
>
> I take it from the above that MS have no problem with the STD_* images
> being
> used in commercial apps?
>
> "Paul Baker [MVP, Windows - SDK]" wrote:
>
>> Dave,
>>
>> Doesn't Visual Studio just use the ones that come with Windows? Anyway,
>> Dan
>> is using Delphi.
>>
>> Dan,
>>
>> You want to use TB_LOADIMAGES like this:
>>
>> ToolBar:= TToolBar.CreateParented(Application.Handle);
>> try
>> ToolBar.Images:= MyImageList;
>> ToolBar.Perform(TB_LOADIMAGES, MyBitmapID, LPARAM(HINST_COMMCTRL));
>> finally
>> ToolBar.Free;
>> end;
>>
>> MyImageList is your TImageList.
>>
>> MyBitmapID would be IDB_STD_LARGE_COLOR or IDB_STD_SMALL_COLOR.
>>
>> Your image indexes would be STD_UNDO, STD_DELETE, STD_FILEOPEN and
>> STD_FILENEW.
>>
>> TB_LOADIMAGES Message:
>> http://msdn2.microsoft.com/en-us/library/bb787381(VS.85).aspx
>>
>> Toolbar Standard Button Image Index Values:
>> http://msdn2.microsoft.com/en-us/library/bb760433(VS.85).aspx
>>
>> Paul
>>
>> "David Lowndes" <DavidL@example.invalid> wrote in message
>> news:u7ags3pt34t09c2jkiubb40s9dkag9nnks@4ax.com...
>> > >The nub of the question is really:
>> >>
>> >>"Am I allowed to?"
>> >>
>> >>The icons I'm looking to use in my toolbar are the standard Undo,
>> >>Delete,
>> >>Open and New icons...
>> >
>> > MS ship a load of freely usable images in Visual Studio. If you have a
>> > VS license you could presumably use those.
>> >
>> > Dave
>>
>>
>>
date: Fri, 29 Feb 2008 15:33:11 -0500
author: Paul Baker [MVP, Windows - SDK] am
|
|