Sign in to follow this  
Followers 0
Tim Net

Add ICON to resource file?

8 posts in this topic

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.

Share this post


Link to post
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

:)


Sorry 4 Bad English, I'm Indonesian...I'm really need 'Translator' for helping me posting in this forum (http://deeriee.wordpress.com)

Share this post


Link to post
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

:)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

It turns out that I was using an old version of Scite and the wrapper. I updated to the newer version and Voila!

Sorry for the trouble. The F7 showed me the icon adding now.

Thanks.

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