Icon from external dll

ManicCW

Well-known member
Joined
Jul 21, 2005
Messages
428
Location
Mostar
Programming Experience
Beginner
Hi,
I have external dll where I keep my resources (images, icons, strings ...). I pull that resources for my application. How do I set application icon from external dll? I'm working in vs 2005.

Tnx
 
is this dll one that you made? if so, just change it so that you can access the content you need by having it store the info as a class
 
Dll is from another project. I have two projects in solution: Project that creates exe file and project with resources that creates dll file. In exe file I pull icons and images from dll file like:

Me.MyToolbarMenuItem.Image = myExternalDll.My.Resources.TollbarClose

But how to set application icon from that dll???
 
VB.NET:
Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (
       ByVal hInst As Integer, ByVal lpszExeFileName As String,
      ByVal nIconIndex As Integer) As Integer

VB.NET:
  Shared Function GetIcon(Component As Component, dllpath As String, IconIndex As Integer) As Icon
        Dim retval As Long
        retval = ExtractIcon(Component.GetHashCode,
              dllpath, IconIndex)
        Return Icon.FromHandle(New IntPtr(retval))
    End Function
 
Back
Top