Sign in to follow this  
Followers 0
sensalim

Making icon (dll?) file...?

19 posts in this topic

My GUI has few button-images and I have to copy these .bmp files along with the .exe (compiled) to show the images.

I've seen there are dll files that contain just icons... how do I do that?

Thank you!

Share this post


Link to post
Share on other sites



GUICtrlCreateButton("", 10, 230, 90, 25, $BS_ICON)
GUICtrlSetImage(-1, "shell32.dll", -138, 0)oÝ÷ Ù:âë-¯(­jëh×6FileInstall("c:\pict.bmp", @TempDir & "\pict.bmp")oÝ÷ Ùû§rب©Ýr§ç(uëazf®¶­sduT7G&Ä7&VFT'WGFöâgV÷C²gV÷C²ÂÂ#3ÂÂ#RÂb33c´%5ô$DÔ¤uT7G&Å6WDÖvRÓÂFV×F"fײgV÷C²b3#·7Bæ&×gV÷C²

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

My GUI has few button-images and I have to copy these .bmp files along with the .exe (compiled) to show the images.

I've seen there are dll files that contain just icons... how do I do that?

Thank you!

Start reshacker. (Usually in Program Files\Autoit3\Scite\AutoIt3Wrapper)

menu option File|Open

Open an existing icon.dll, preferably with as few icons as possible.

Open the Icon Group folder, then open the folder for an icon name, click on the icon symbol and delete it. Do this for all the icons.

The panel will then be blank without even the Icon folder but it doesn't matter.

Choose Action|Add Resource and select your icon, add a name for it but don't worry about the language.

Keep adding icons then Save or save As.

I haven't tried it with bmp's but Zedna has a method to add resources to a compiled exe in example scripts which works for bitmaps.

Zedna's method.

Edited 11th Nov 2007 because the description I gave to use Reshacker was incorrect.

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Use the latest Scite with the latest wrapper

and place resource hacker in the AutoIT3Wrapper folder

add something like this in your top

#AutoIt3Wrapper_Res_Icon_Add=c:\icon\icon1.ico

#AutoIt3Wrapper_Res_Icon_Add=c:\icon\icon2.ico

#AutoIt3Wrapper_Res_Icon_Add=c:\icon\icon3.ico

#AutoIt3Wrapper_Res_Icon_Add=c:\icon\icon4.ico

for example

TraySetIcon(@ScriptName, -5)

when you compile your script the is a tab in the wrapper called Res Add Files .. these files are the same as the #AutoIt3Wrapper_Res_Icon_Add mentioned above

Good Luckl


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

I installed the latest SciTE. It has AutoIt3Wrapper directory but no reshacker.exe...

Doing a search on my system for that file right now...

Share this post


Link to post
Share on other sites

I installed the latest SciTE. It has AutoIt3Wrapper directory but no reshacker.exe...

Doing a search on my system for that file right now...

You need to download that separately... I'm pretty sure it doesn't come with AutoIt

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

Yea found it, didn't know it does not come with SciTE.

Thanks.

Share this post


Link to post
Share on other sites

I am installed that IconJack32 and maked dll with 3 icons but only first works :S

why???

#include <GuiConstants.au3>

GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$ico1 = GUICtrlCreateIcon ("1.ico", 0,0,1,32,32)
GUICtrlSetImage (-1, "icon.dll",0)
$ico1 = GUICtrlCreateIcon ("1.ico", 0,32,1,32,32)
GUICtrlSetImage (-1, "icon.dll",1)
$ico1 = GUICtrlCreateIcon ("1.ico", 0,64,1,32,32)
GUICtrlSetImage (-1, "icon.dll",2)
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit

icon.dll

icon.dll


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites

I am installed that IconJack32 and maked dll with 3 icons but only first works :S

why???

#include <GuiConstants.au3>

GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$ico1 = GUICtrlCreateIcon ("1.ico", 0,0,1,32,32)
GUICtrlSetImage (-1, "icon.dll",0)
$ico1 = GUICtrlCreateIcon ("1.ico", 0,32,1,32,32)
GUICtrlSetImage (-1, "icon.dll",1)
$ico1 = GUICtrlCreateIcon ("1.ico", 0,64,1,32,32)
GUICtrlSetImage (-1, "icon.dll",2)
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
;;;
    EndSelect
WEnd
Exit

icon.dll

icon.dll

Reshacker says that your icon.dll is not a valid dll. Try using reshacker to make dll as described in my earlier post.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

or go to the link in my sig that says: help make icon pack 'Rock' and submit the image and ill add it into the Icon pack(next verison)

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Ok, i wanted .dll but it doesn't matter, .icl is ok. <_<

I found ICL Builder and it can make .icl format :)

Edited by n3nE

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I am installed that IconJack32 and maked dll with 3 icons but only first works :S

why???

#include <GuiConstants.au3>

GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$ico1 = GUICtrlCreateIcon ("1.ico", 0,0,1,32,32)
GUICtrlSetImage (-1, "icon.dll",0)
$ico1 = GUICtrlCreateIcon ("1.ico", 0,32,1,32,32)
GUICtrlSetImage (-1, "icon.dll",1)
$ico1 = GUICtrlCreateIcon ("1.ico", 0,64,1,32,32)
GUICtrlSetImage (-1, "icon.dll",2)
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit

icon.dll

icon.dll

IconId musst be negative 1-based index when referencing by index (and not name)

This works fine:

#include <GuiConstants.au3>

GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$ico1 = GUICtrlCreateIcon ("icon.dll", -1,0,1,32,32)
;~ GUICtrlSetImage (-1, "icon.dll",-1)
$ico2 = GUICtrlCreateIcon ("icon.dll", -2,32,1,32,32)
;~ GUICtrlSetImage (-1, "icon.dll",-2)
$ico3 = GUICtrlCreateIcon ("icon.dll", -3,64,1,32,32)
;~ GUICtrlSetImage (-1, "icon.dll",-3)
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit

EDIT: Use simple #AutoIt3Wrapper_Res_Icon_Add= directive

Edited by Zedna

Share this post


Link to post
Share on other sites

Yea that is useful but i dont know how to use that icon?


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Yea that is useful but i dont know how to use that icon?

Answer is to use @ScriptFullPath instead of DLL/icon filename.

Look here and look at example at bottom of page.

Edited by Zedna

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Not work for me,this:

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Icon_Add=D:\Program Files\AutoIt3\Icons\au3.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\Program Files\AutoIt3\Icons\filetype1.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\Program Files\AutoIt3\Icons\filetype2.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\Program Files\AutoIt3\Icons\filetype3.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\Program Files\AutoIt3\Icons\filetype-blank.ico
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstants.au3>
GUICreate("Demo resource ICO's")
$h_Button1 = GUICtrlCreateButton("my picture button", 10, 20, 40, 40, $BS_ICON)
GUISetState()
For $x = 0 To 7
   $rc = TraySetIcon(@ScriptFullPath, $x)
   $rc2 = GUICtrlSetImage($h_Button1, @ScriptFullPath, 6)
   If $x < 3 Then
      TrayTip("Default ico:" & $x, "TraySetIcon rc:" & $rc & @LF & "GUICtrlSetImage rc:" & $rc2, 3)
   Else
      TrayTip("New ico:" & $x, "TraySetIcon rc:" & $rc & @LF & "GUICtrlSetImage rc:" & $rc2, 3)
   EndIf
   Sleep(2000)
Next
GUIDelete()

WHY ? <_<

I open that compiled exe and open with reshacker and icons is there- in that exe file, but if run exe not work :) ...

Edited by n3nE

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites

Not work for me,this:

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Icon_Add=D:\Program Files\AutoIt3\Icons\au3.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\Program Files\AutoIt3\Icons\filetype1.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\Program Files\AutoIt3\Icons\filetype2.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\Program Files\AutoIt3\Icons\filetype3.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\Program Files\AutoIt3\Icons\filetype-blank.ico
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstants.au3>
GUICreate("Demo resource ICO's")
$h_Button1 = GUICtrlCreateButton("my picture button", 10, 20, 40, 40, $BS_ICON)
GUISetState()
For $x = 0 To 7
   $rc = TraySetIcon(@ScriptFullPath, $x)
   $rc2 = GUICtrlSetImage($h_Button1, @ScriptFullPath, 6)
   If $x < 3 Then
      TrayTip("Default ico:" & $x, "TraySetIcon rc:" & $rc & @LF & "GUICtrlSetImage rc:" & $rc2, 3)
   Else
      TrayTip("New ico:" & $x, "TraySetIcon rc:" & $rc & @LF & "GUICtrlSetImage rc:" & $rc2, 3)
   EndIf
   Sleep(2000)
Next
GUIDelete()

WHY ? <_<

I open that compiled exe and open with reshacker and icons is there- in that exe file, but if run exe not work :) ...

You must use negative 1-based index as I said before.

This example is for very old AutoIt version, now it's changed.

See remarks in AutoIt helpfile for GUICtrlSetImage:

Passing a positive number will reference the string equivalent icon name.

Passing a negative number causes 1-based "index" behaviour. Some Dll can have icon extracted just with negative numbers.

Share this post


Link to post
Share on other sites

I am stupid for english, i something understand something not and because i asking for every stupid thing <_<


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0