| View previous topic :: View next topic |
| Author |
Message |
Tommyknocker
Joined: 09 Mar 2010 Posts: 2
|
Posted: Tue Mar 09, 2010 3:25 pm Post subject: How to change icons with a macro? |
|
|
Hello,
I would like to change some icons in my Passolo project with a macro.
I tried the following to replace two icons (with ID 4 and ID 128)
| Code: |
' Loop all resources
For i = 1 To trn.ResourceCount
Dim res As PslResource
Set res = trn.Resource(i)
If res.IsBinary And res.Type = "IconGroup" Then
Select Case res.ID
Case 4
res.ImportBinary("C:\icon.ico")
Case 128
res.ImportBinary("C:\icon.ico")
End Select
End If
Next i
|
But this does not work.
Can anyone help me?
Is there an error in the code or is it the complete wrong way to change icons with a macro?
Thank you for your help |
|
| Back to top |
|
 |
Uwe Site Admin
Joined: 28 Jan 2005 Posts: 247 Location: Bonn, Germany
|
Posted: Wed Mar 10, 2010 4:19 pm Post subject: |
|
|
Hi,
your macro is ok.
The problem is: with Win32 icons are stored in different resource types:
IconGroup to list the available icon images and one Icon resource for every image. It's not possible to create additional resources when importing icons. So you cannot import an icon that has different image count or resolution. |
|
| Back to top |
|
 |
Tommyknocker
Joined: 09 Mar 2010 Posts: 2
|
Posted: Thu Mar 11, 2010 6:18 pm Post subject: |
|
|
Thank you very much.
The problem was a different image count and different resolutions! |
|
| Back to top |
|
 |
|