Jump to content
Sign in to follow this  
NEO12

Problem With Icon in Tray

Recommended Posts

NEO12

Hi everbody

When i compile my script to an exe i chose an icon. but when i start my application the icon doesn't appear.

Can Someone help me??

here is the code i use

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Version=beta
#AutoIt3Wrapper_icon=..\..\..\..\Program Files\AutoIt3\Icons\AU32.ico
#AutoIt3Wrapper_outfile=Just For You.exe
#AutoIt3Wrapper_UseUpx=n
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
#NoTrayIcon
#Include <Constants.au3>
#include <Word.au3>
#include <Excel.au3>
#include <Inet.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <File.au3>


Opt("TrayMenuMode",1); Default tray menu items (Script Paused/Exit) will not be shown.

$settingsitem   = TrayCreateMenu("Settings")
$displayitem    = TrayCreateItem("Open CD/DVD", $settingsitem)
$printeritem    = TrayCreateItem("Close CD/DVD", $settingsitem)
$worditem      = TrayCreateItem("Word", $settingsitem)
$excelitem     = TrayCreateItem("Excel", $settingsitem)
$PublicIPitem   = TrayCreateItem("IP", $settingsitem)
$Recycleitem     =TrayCreateItem ("Empty Bin", $settingsitem)
$Chatitem       =TrayCreateItem("Chat", $settingsitem)

TrayCreateItem("")
$aboutitem      = TrayCreateItem("About")
TrayCreateItem("")
$exititem       = TrayCreateItem("Exit")


TraySetState()
TrayTip("", "Hello", 5)
While 1
        $msg = TrayGetMsg()
    Select
        Case $msg = $displayitem
            CDTray("E:", "open")
        Case $msg = $aboutitem
            Msgbox(64,"About:","Author: S├ębastien Bauval")
        Case $msg = $printeritem
            CDTray("E:", "Close")
        Case $msg= $worditem
            $oWordApp = _WordCreate ("")
        Case $msg= $excelitem
            $oExcel = _ExcelBookNew()
        Case $msg =$PublicIPitem
            $PublicIP = _GetIP()
            MsgBox(0, "IP Address", "Your IP Address is: " & $PublicIP)
        Case $msg = $Recycleitem
            FileRecycleEmpty ( "" )
        Case $msg = $Chatitem
            Run ("Chat.exe")
        Case $msg = $exititem

    Switch @HOUR
Case 6 To 11
    $msg = "Good Morning!"
Case 12 To 17
    $msg = "Good Afternoon!"
Case 18 To 21
    $msg = "Good Evening!"
Case Else
    $msg = "What are you still doing up?!"
EndSwitch

TrayTip("", "Bye", 5)

MsgBox(0, Default, $msg)
    $msg = TrayGetMsg()
                ExitLoop
    EndSelect
WEnd

Exit

And the icon i use is:post-50902-1245412194_thumb.png

Thanks

Share this post


Link to post
Share on other sites
LurchMan

take out #NoTrayIcon


Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Share this post


Link to post
Share on other sites
NEO12

take out #NoTrayIcon

Thank you

It works on vista but not on XP.

I don't know what i'm doing wrong.

Edit: It only works on XP when i compile it with the default icon

Edited by NEO12

Share this post


Link to post
Share on other sites
LurchMan

Thank you

It works on vista but not on XP.

I don't know what i'm doing wrong.

Edit: It only works on XP when i compile it with the default icon

if it works with default icon then theres something wrong with the icon


Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Share this post


Link to post
Share on other sites
NEO12

if it works with default icon then theres something wrong with the icon

You re right it tested with another icon(downloaded from png fact) and it works. my icon was "dead".

Yhank you for your great help. :D

Share this post


Link to post
Share on other sites
Inverted

Did you really try to use a 256x256 icon ?!?!?!

Share this post


Link to post
Share on other sites
NEO12

Did you really try to use a 256x256 icon ?!?!?!

No it was the png-file that i uploaded. The icon is 32x32 if i remeber.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.