Jump to content

Add ICON to resource file?


Tim Net
 Share

Recommended Posts

I've tried this several different ways and can't seem to get it to work.

I do have three ico files, resource hacker in the right spot and it does compile.

#AutoIt3Wrapper_Res_Icon_Add=D:\Temp\icon\1.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\Temp\icon\2.ico 
#AutoIt3Wrapper_Res_Icon_Add=D:\Temp\icon\3.ico 


HotKeySet("{ESC}","quit")
while 1
    TraySetIcon( "D:\Temp\icon\1.ico",3)    
    sleep(1000)
    TraySetIcon( "D:\Temp\icon\2.ico",4)    
    sleep(1000)
    TraySetIcon( "D:\Temp\icon\3.ico",5)    
    sleep(1000)
WEnd

I just want the tray icon to rotate.

Thanks.

Link to comment
Share on other sites

Try this :

#AutoIt3Wrapper_Res_Icon_Add=D:\Temp\icon\1.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\Temp\icon\2.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\Temp\icon\3.ico


HotKeySet("{ESC}","quit")
while 1
    TraySetIcon( "D:\Temp\icon\1.ico",3)    
    sleep(1000)
    TraySetIcon( "D:\Temp\icon\2.ico",4)    
    sleep(1000)
    TraySetIcon( "D:\Temp\icon\3.ico",5)    
    sleep(1000)
WEnd

Func quit()
    Exit
EndFunc

:)

Link to comment
Share on other sites

Try what? Don't worry about the quit() function, that works just fine. It's the icon changes that I am trying to get moving.

Did I miss something else in the guts of the code?

Thanks.

Try this :

#AutoIt3Wrapper_Res_Icon_Add=D:\Temp\icon\1.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\Temp\icon\2.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\Temp\icon\3.ico


HotKeySet("{ESC}","quit")
while 1
    TraySetIcon( "D:\Temp\icon\1.ico",3)    
    sleep(1000)
    TraySetIcon( "D:\Temp\icon\2.ico",4)    
    sleep(1000)
    TraySetIcon( "D:\Temp\icon\3.ico",5)    
    sleep(1000)
WEnd

Func quit()
    Exit
EndFunc

:)

Link to comment
Share on other sites

  • Developers

You are not referring to the internal stored Icons when you run the compiled script.

Look at the example in the SciTE4AutoIt3 helpfile which can be found in the AutoIt3Wrapper section.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

There are default 4 icons in EXE so your first icon must have (negative 1-based) index -5:

#AutoIt3Wrapper_Res_Icon_Add=D:\Temp\icon\1.ico
#AutoIt3Wrapper_Res_Icon_Add=D:\Temp\icon\2.ico 
#AutoIt3Wrapper_Res_Icon_Add=D:\Temp\icon\3.ico 

HotKeySet("{ESC}","quit")

while 1
    TraySetIcon(@ScriptFullPath,-5)    
    sleep(1000)
    TraySetIcon(@ScriptFullPath,-6)    
    sleep(1000)
    TraySetIcon(@ScriptFullPath,-7)    
    sleep(1000)
WEnd

EDIT: Next time post in correct forum.

Edited by Zedna
Link to comment
Share on other sites

What group should this have gone to?

#AutoIt3Wrapper_Res_Icon_Add=d:\temp\icon\1.ico
#AutoIt3Wrapper_Res_Icon_Add=d:\temp\icon\2.ico 
#AutoIt3Wrapper_Res_Icon_Add=d:\temp\icon\3.ico 

HotKeySet("{ESC}","quit")
while 1
    TraySetIcon( @ScriptFullPath,-5)    
    sleep(1000)
    TraySetIcon( @ScriptFullPath,-6)    
    sleep(1000)
    TraySetIcon( @ScriptFullPath,-7)    
    sleep(1000)
WEnd

func quit()
    Exit
endfunc

I am using code and arguments that look correct . Resource Hacker(reshack.exe) is in the "C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper" directory(C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\ResHacker.exe) and the "Compile with Options" shows the second tab achecked for "Update Target program resource information".

I am using AutoIT 3.2.12.1.

If I open .exe with reshacker.exe, I do not see any of the .ico files embedded that I am trying to get working. When I conpile with options, I can see the reference to ResHacker.exe passing by but it just seems like it's not attaching.

Any ideas?

Thanks.

Link to comment
Share on other sites

  • Developers

What group should this have gone to?

Where it is now... I moved it from Examples.

What group should this have gone to?

#AutoIt3Wrapper_Res_Icon_Add=d:\temp\icon\1.ico
#AutoIt3Wrapper_Res_Icon_Add=d:\temp\icon\2.ico 
#AutoIt3Wrapper_Res_Icon_Add=d:\temp\icon\3.ico 

HotKeySet("{ESC}","quit")
while 1
    TraySetIcon( @ScriptFullPath,-5)    
    sleep(1000)
    TraySetIcon( @ScriptFullPath,-6)    
    sleep(1000)
    TraySetIcon( @ScriptFullPath,-7)    
    sleep(1000)
WEnd

func quit()
    Exit
endfunc

I am using code and arguments that look correct . Resource Hacker(reshack.exe) is in the "C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper" directory(C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\ResHacker.exe) and the "Compile with Options" shows the second tab achecked for "Update Target program resource information".

I am using AutoIT 3.2.12.1.

If I open .exe with reshacker.exe, I do not see any of the .ico files embedded that I am trying to get working. When I conpile with options, I can see the reference to ResHacker.exe passing by but it just seems like it's not attaching.

Any ideas?

Thanks.

Post the text shown in the SciTEoutput pane to see what is happening when you press F7.

By the way: Reshacker is not used by AutoIt3Wrapper anymore since the last couple of releases.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...