![]() |
ImageManager.AddIcon using ExtractIcon |
Post Reply ![]() |
Author | |
Shawshank ![]() Senior Member ![]() Joined: 16 October 2005 Status: Offline Points: 117 |
![]() ![]() ![]() ![]() ![]() Posted: 23 February 2006 at 6:55pm |
I am attempting to add an icon to the ImageManager and then subsequently assigning it to a ReportRecordItem. I use the following: iIdx% = -152 lIconIdx& = (Me.ImageMan.Icons.Count + 1) sIconPath$ = "C:\Windows\System32\shell32.dll" hIcon& = ExtractIcon(frmMain.hWnd, sIconPath$, iIdx%) Me.ImageMan.Icons.AddIcon hIcon&, lIconIdx&, xtpImageNormal This code certainly returns an icon handle and appears to properly add the icon to the ImangeManager. I see that the ImageManager Icon.Count property increments by one. I then try to assign the icon to the ReportRecordItem like so: r.Item(1).Icon = lIconIdx& After calling Me.rc.Populate I see that the text of the ReportRecordItem has shifted to the right somewhat as though the icon was there. However, if it is there it is invisible. I've tried any number of different indexes into the shell32.dll library but all have the same result. I suspect the issue is related to there being multiple icons within a single icon file? If so, is there a way around this? Or, perhaps my code is incorrect? Thx |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello, ExtractIcon by default loads 32*32 icon. Try ExtractIconEx: ExtractIconEx "C:\Windows\System32\shell32.dll", -152, 0, hIcon, 1 |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Shawshank ![]() Senior Member ![]() Joined: 16 October 2005 Status: Offline Points: 117 |
![]() ![]() ![]() ![]() ![]() |
Many, many thxs. That did the trick!
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |