Home > Archive > Visual Basic > November 2005 > Adding an icon to a dll
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Adding an icon to a dll
|
|
| Harry Strybos 2005-11-29, 6:55 pm |
| Hi All
Can someone me how to add an icon to a dll. Thak is to say, when I build a
dll, how do I get it to use a different icon in the build options?
Can't seem to find any info on the web
Thanks
| |
| Karl E. Peterson 2005-11-29, 6:55 pm |
| Harry Strybos wrote:
> Can someone me how to add an icon to a dll. Thak is to say, when I
> build a dll, how do I get it to use a different icon in the build
> options?
"Use" it in what way?
Is a resource file not meeting your needs?
--
Working without a .NET?
http://classicvb.org/
| |
| Mark Alexander Bertenshaw 2005-11-30, 3:55 am |
| Only EXE files show as a specific icon in Windows Explorer. Even if you use
a form's icon in Build Options.
--
Mark Bertenshaw
Kingston upon Thames
UK
"Harry Strybos" <harry_NOSPAM@ffapaysmart.com.au> wrote in message
news:B64jf.1076$WM.29375@nasal.pacific.net.au...
> Hi All
>
> Can someone me how to add an icon to a dll. Thak is to say, when I build a
> dll, how do I get it to use a different icon in the build options?
>
> Can't seem to find any info on the web
>
> Thanks
>
>
| |
|
|
"Harry Strybos" <harry_NOSPAM@ffapaysmart.com.au> wrote in message
news:B64jf.1076$WM.29375@nasal.pacific.net.au...
> Hi All
>
> Can someone me how to add an icon to a dll. Thak is to say, when I build a
> dll, how do I get it to use a different icon in the build options?
>
I assume you mean you want the DLL to show a different icon than the generic
dll icon in explorer-type views? There are 2 things you must do. First, add
a resource file containing the desired icon to the DLL project. The
resource ID must be "first". If it's the only icon added to the resource,
this is no problem. Second, you must make a change in the Registry. You
must change the default value of "HKEY_CLASSES_ROOT\dllfile\DefaultIcon" to
be "%1" (without the quotes). Since you need to mess with the Registry, I
would NOT recommend doing this on users' PCs. If you want to do it on your
own PC, fine. A side-affect is that all DLLs that don't have an icon
resource will use the really generic "no associated icon" icon.
--
Mike
Microsoft MVP Visual Basic
|
|
|
|
|