Jump to content

I need some help creating an icon control. [fixed]


Recommended Posts

After messing around for hours I decided it was time to get some help.

I'd like to use a few icon controls instead of buttons to maky my script look better. I've included the icons in my compiled script using compile with option, wich added the following to my script:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=ico\Library.ico ;the icon the exe will use
#AutoIt3Wrapper_Res_Fileversion=1.0.0.1
#AutoIt3Wrapper_Res_Icon_Add=ico\user_remove.ico ;control icon 1
#AutoIt3Wrapper_Res_Icon_Add=ico\user_add.ico ;control icon 2
#EndRegionoÝ÷ Øý½ë¬yÚÞ²«qèZrG«¶!yÉ"~Ø^Ê'³^­è§r[yÖ§vØ^ɪ޶«yIÝz¸¢{-ì¢g®§­Ø^¢·b©gjg¬çF§wg¢Ú®×¬º·°«m«fy©ìRw^®'(
èº-ì¢g®¥«6ÓV§wm6#ozëte
Úå
·µâ¢{h±ëÞ­©brì~º&²¥}V§tazr¢é]ë-ºÇéz¶¬¶¢µé§jg¡£¯z²j}ý¶­ÛhÂä~æÉì^N¬É²{¦¦W¬r¸©µ«­¢+ØÀÌØí¥½¸ôÅÕ½ÐìÅÕ½Ðìí$ÍÍÕµ$¹Ñ¼ÁÕÐͽµÙ±Õ¡É°ÕС½Ü¼$¥¹Ñ¡É¥¡Ð½¹ü)U%
ÉÑ ÅÕ½ÐíÑÍÐÅÕ½Ðì°ÈÀÀ°ÈÀÀ¤)U%MÑMÑÑ ¤)U%
Ñɱ
ÉÑ%½¸¡MÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈíÁÉÍȹáÅÕ½Ðì°ÀÌØí¥½¸°ÄÀ°ÄÀ°ÄØ°Äؤ()]¡¥±U%Ñ5Í ¤±ÐìÐì´Ì)]¹

I've been able to use the icon used by the exe (Library.ico), but how do I find the values for the other icons I added?

I hope someone can point me in the right direction. Thanks in advance.

Edit: If this can be done using pictures instead of icons that would be nice too.

Edit2: Ofcoarse I figured it out after asking for help muttley using the number of the imagegroup for $icon works. If anyone can tell me how to specify a specific icon in that imagegroup (when including a multi resolution icon) that would be cool though.

Edited by Tvern
Link to comment
Share on other sites

There's a way to use an RT_ICON from an RT_GROUP_ICON, but it's not short.

It involves the functions LoadLibrary(), ResourceEnumNames(), FindResource(), LoadResource(), SizeOfResource(), LockResource(), CreateIconFromResource().

If the RT_ICON is a PNG icon then also CreateStreamOnHGlobal(), GdipCreateBitmapFromStream(), GdipCreateHICONFromBitmap().

All the above functions I'm using in icon viewing & extraction utility I've written and posted recently to do exactly "how to specify a specific icon in that imagegroup (when including a multi resolution icon)".

Sorry I don't have a brief simple example to demonstrate the above on hand atm.

But you can work it all out using Zedna's Resources.au3, ProgAndy's BinaryImage.au3 and MSDN.

Cheers

Link to comment
Share on other sites

Thanks for the responses. I played around a bit trying to find the right resolution icon, but since I am adding the icons myself it's easier to just add more single icons. Atleast it's working now. muttley

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...