Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Adding icons to ImaageManager .AddIcon
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Adding icons to ImaageManager .AddIcon

 Post Reply Post Reply
Author
Message
Shawshank View Drop Down
Senior Member
Senior Member


Joined: 16 October 2005
Status: Offline
Points: 117
Post Options Post Options   Thanks (0) Thanks(0)   Quote Shawshank Quote  Post ReplyReply Direct Link To This Post Topic: Adding icons to ImaageManager .AddIcon
    Posted: 22 February 2006 at 12:26am

I am attempting to dynamically load file type association icons into the ImageManager. This means some times the icon is a full path to a .ico file or it can be indexed into a library file or EXE. In this latter case I use ExtractIcon to get the handle. That works fine. It isn't until I try to add the icon to the ImageManager via .AddIcon that I have trouble. ExtractIcon provides me with a handle and I assign that to the ImageManager.AddIcon property. Checking the Watch window I see that the .Count property for the ImageManager.Cont property has increased by one. This leads me to believe that it was successful. When I then attempt to add the icon from the Imagemanager to the ReportRecordItem that trouble occurs. It simply doesn't appear --even after a .Populate call.

iPos% = InStrRev(sIconPath$, ",")
        
If iPos% Then
        
      iIdx% = Mid$(sIconPath$, (iPos% + 1))
             
      sIconPath$ = Left$(sIconPath$, (iPos% - 1))
             
      sIconPath$ = Replace(sIconPath$, """", "")
             
       If gFSO.FileExists(sIconPath$) Then
             
                 hIcon& = ExtractIcon(frmMain.hWnd, sIconPath$, iIdx%)
        
        End If

End If

lIconIdx& = (Me.ImageMan.Icons.Count + 1)

Me.ImageMan.Icons.AddIcon hIcon&, lIconIdx&, xtpImageNormal

Me.rc.Records.Record(lIdx&).Item(1).Icon = lIconIdx&

I have no trouble using .LoadIcon. Is there something wrong with the code above? Should it not work? Any insight would be greatly appreciated!

Back to Top
Shawshank View Drop Down
Senior Member
Senior Member


Joined: 16 October 2005
Status: Offline
Points: 117
Post Options Post Options   Thanks (0) Thanks(0)   Quote Shawshank Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2006 at 8:53am
Using ExtractIconEx solved the issue. ExtractIcon loads 32x32 by default.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.