Jump to content

No custom GUI icon in taskbar when au3 script is executed by "Run script" option


Go to solution Solved by argumentum,

Recommended Posts

Posted

My Autoit script contains code which show GUI with custom icon (GuiSetIcon() function is used).

When I compile my script to exe and run it then I can see my custom icon on the windows taskbar but when I run my script with option "Run script" then I see default AutoIt icon on the taskbar.

I want see my custom icon on the taskbar when I run my script with option "Run script" or I when I use code:

Run("C:\Program Files (x86)\AutoIt3\Autoit3.exe" "C:\myscript.au3")

Any idea?

Posted
Posted

but he says

 

2 hours ago, maniootek said:

When I compile my script to exe and run it then I can see my custom icon on the windows taskbar

 

 

 

I know that I know nothing

Posted

 

@maniootek try compile this script

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=C:\Program Files (x86)\AutoIt3\Icons\MyAutoIt3_Red.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>

Example()

Func Example()

    GUICreate("My GUI new icon") ; will create a dialog box that when displayed is centered
    $sFile = "C:\Program Files (x86)\AutoIt3\Icons\MyAutoIt3_Red.ico"

    GUISetIcon($sFile) ; will change icon

    GUISetState(@SW_SHOW); will display an empty dialog box

    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop

        EndSwitch
    WEnd

    GUIDelete()
EndFunc   ;==>Example

 

I know that I know nothing

Posted

This works for me compiled/uncompiled:

;#NoTrayIcon
#include <GUIConstantsEx.au3>

GUICreate("Test", 300, 200)
GUISetIcon(@ScriptDir & '\test.ico')
TraySetIcon(@ScriptDir & '\test.ico')
GUISetState(@SW_SHOW)

While 1
    If GuiGetMsg() = $GUI_EVENT_CLOSE Then Exit
WEnd

Anyway try this if you use embeded icon added at compile time by #AutoIt3Wrapper:

#AutoIt3Wrapper_icon=test.ico

;#NoTrayIcon
#include <GUIConstantsEx.au3>

GUICreate("Test2", 300, 200)
If Not @Compiled Then
    GUISetIcon(@ScriptDir & '\test.ico')
    TraySetIcon(@ScriptDir & '\test.ico')
EndIf
GUISetState(@SW_SHOW)

While 1
    If GuiGetMsg() = $GUI_EVENT_CLOSE Then Exit
WEnd

 

Posted (edited)

Tray icon and gui icon is no problem, it works, It's all about Windows 10 taskbar icon when script is run as a parameter of autoit.exe (run script option)

Your code also show autoit icon (not custom icon).

image.png.8c1e5f1bf8ee54602b2623f379a36e31.png

image.png.9271493346735cd3b3d32044752108e3.png

Edited by maniootek
Posted (edited)

My AutoIt version 3.3.14.5 and it's not working

I remember it used to work before

Edit: I just installed 3.3.16.1 and it's still not working.

Edited by maniootek
Posted

This is not that easy as it seems to be. It is working when I move the au3 file into AutoIt.exe file but when I use "Run script" option from context menu it doesn't (even if I use same AutoIt version). Please check movie:

 

Posted (edited)

i check it out...

...and nothing.  You have right.  This is possible only by drop

Edited by ioa747
i check it out...

I know that I know nothing

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
  • Recently Browsing   0 members

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