Sign in to follow this  
Followers 0
Diana (Cda)

Change taskbar icon?

10 posts in this topic

Is there no way to change the taskbar icon for scripts themselves and not just in compiled scripts?

I have too many I'd like to change without making the size of the folder increase since the compiled scripts are so much larger than just a plain script.

Thanks. :D

Share this post


Link to post
Share on other sites



well afaik the icon a script gets when RUN'd not COMPILE'd is from the autoexe program so hmmm. why would you want to change the icon anyway


----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Use GUISetIcon, TraySetIcon in your AU3 scripts and reference to external ICO files.

Yes, searching the forum before posting this thread here yielded GUISetIcon; and I use TraySetIcon all the time.

GUISetIcon doesn't seem to work on simple, uncompiled scripts. And the help file says: "Sets the icon used in a GUI window". Several trials show that it doesn't seem to affect the taskbar icon at all.

TraySetIcon only deals with the system tray icon. It's great and I use it a lot. However, again, no change to the taskbar icon. The regular AutoIt one is what appears. Chosen icons are grabbed when scripts are compiled, granted. However, as I mentioned above, would rather have something that works on simple, uncompiled scripts as compiled ones are much, much larger in size. I use a few looping scripts rather frequently which stay resident in the systray. During the "active" phase of these, the taskbar shows the script. It would be nice, for quick visual reference, to see instead something more pertinent than the generic AI icon.

So nothing works on AU3 files only?

Thanks. :D

Edited by Diana (Cda)

Share this post


Link to post
Share on other sites

At least in v3.2.10.0 this are the Icon changes:

GUIsetIcon: Changes the Icon of GUI and it's Icon on the TaskButton

TraySetIcon: Changes the icon in the tray.

THe only Icon that can't be changed without compiling is the one in TaskSwitch-Dialog.


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

At least in v3.2.10.0 this are the Icon changes:

GUIsetIcon: Changes the Icon of GUI and it's Icon on the TaskButton

TraySetIcon: Changes the icon in the tray.

THe only Icon that can't be changed without compiling is the one in TaskSwitch-Dialog.

Hmmm, I must be doing something wrong. Thanks for the info. I dl v3.2.10.0 so now have the right version to do this with.

Perhaps I should give my script so that someone who knows can pinpoint what I'm doing wrong since this isn't working:

;
; AutoIt 3x
;
#NoTrayIcon     ; AutoIt's icon doesn't show in systray
TraySetIcon(@ScriptDir & "\PUAC- 01- start PUAC (+loops).ico")


While 1

SoundPlay(@ScriptDir & "\WAV-PrPrint.wav")
Sleep(2500)

$oSp = ObjCreate("SAPI.SpVoice")
$oSp.Speak("poo ack ... question.")  ; voice prompt for this PUAC script.

Sleep(1000)

If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
$iMsgBoxAnswer = MsgBox(33,"PUAC, start it if off?               [This box times out in 15 seconds.]","Do you want to start PUAC?" & @CRLF & @CRLF & "(This reminder is set to loop, so it will return until you press CANCEL.)",15)     ; "15" at end means timeout occurs in 15 seconds
Select
    Case $iMsgBoxAnswer = 1 ;OK
        GUISetIcon(@ScriptDir & "\PUAC- 01- start PUAC (+loops).ico")
        SoundPlay(@ScriptDir & "\WAV-Wookie.wav")
        $SamePartition = StringLeft(@ScriptDir, 2)
        If NOT ProcessExists("Puac.exe") Then ShellExecute($SamePartition & "\alarm,TaskScheduler - PUAC v2.0.7\APP- PUAC v2.0.7\Puac.exe")
        Sleep(1500)
        Exit     ; finished
    Case $iMsgBoxAnswer = 2 ;Cancel
        Exit
    Case $iMsgBoxAnswer = -1 ;Timeout
        
EndSelect


Sleep (1800000)     ; Sleep for 1,800,000 = 30 minutes / 60,000 units = 1 minute / 30,000=30 seconds / 15,000=15 seconds / 10,000=10 seconds / 5,000=5 seconds


WEnd
The systray icon is changed but the taskbar one is still an AutoIt one. Is it because I'm using a regular message box rather than a GUI? I'd prefer to keep the message box but if it is the source of the problem, then I'll have to change it. Even with the GUI builder helpers, I'm not very good at that yet.

Also, I originally had the GUIsetIcon at the top under TraySetIcon but no matter where I put this, AI's general icon appears. <sigh> Betcha the answer is an easy one, but I'm still butting my head against the wall <g>.

Anyway, thanks. :D

Share this post


Link to post
Share on other sites

GUISetIcon works just for GUIs created by yourself :D MsgBoxes have the predefined Icon of the Running Exe.


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

The systray icon is changed but the taskbar one is still an AutoIt one. Is it because I'm using a regular message box rather than a GUI? I'd prefer to keep the message box but if it is the source of the problem, then I'll have to change it. Even with the GUI builder helpers, I'm not very good at that yet.

Also, I originally had the GUIsetIcon at the top under TraySetIcon but no matter where I put this, AI's general icon appears. <sigh> Betcha the answer is an easy one, but I'm still butting my head against the wall <g>.

Anyway, thanks. :D

If you use the current Beta version, you can make use of the change that was introduced in beta 3.2.11.6

- Added #39: Added parent window parameter to MsgBox(), FileSelectFolder(), FileOpenDialog(), FileSaveDialog().

Using the parent window parameter means msgbox no longer pops up on the taskbar as a separate icon; you only ever see you main Gui icon:

;must use AutoIt beta v . 3.2.11.6 or later
$gui = GUICreate("test")
GUISetIcon(@WindowsDir & "\system32\Calc.exe")
GUISetState()
MsgBox(0,"","hi",0,$gui)

Share this post


Link to post
Share on other sites

If you use the current Beta version, you can make use of the change that was introduced in beta 3.2.11.6

Using the parent window parameter means msgbox no longer pops up on the taskbar as a separate icon; you only ever see you main Gui icon:

;must use AutoIt beta v . 3.2.11.6 or later
$gui = GUICreate("test")
GUISetIcon(@WindowsDir & "\system32\Calc.exe")
GUISetState()
MsgBox(0,"","hi",0,$gui)
Wow, thanks for the info! I'll try it.

Just a quick concern that popped up with this, can we time out the MsgBox, as per normal? Or is that a whole new ball game with new syntax to time out the GUI instead, somehow?

Cheers. :D

Share this post


Link to post
Share on other sites

Wow, thanks for the info! I'll try it.

Just a quick concern that popped up with this, can we time out the MsgBox, as per normal? Or is that a whole new ball game with new syntax to time out the GUI instead, somehow?

Cheers. :D

MsgBox(0, "", "Hi", 0 <<====== This is still the timeout parameter.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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