Sign in to follow this  
Followers 0
zeroZshadow

tray problems

4 posts in this topic

why don't the stupid tray items work....

;GoTray has bin made By ZeroZshadoW
;By idea of mG|tegel

#Include <Constants.au3>
#NoTrayIcon

;Options
Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1)
Opt("WinTitleMatchMode",2)
TraySetClick(16)

;Menu
$Hide = TrayCreateItem ( "Hide" )
TrayCreateItem ( "" )
$List = TrayCreateMenu ( "Hidden List" )
TrayCreateItem ( "" )
$About = TrayCreateItem ( "About" )
$Exit = TrayCreateItem ( "Exit" )

;Events
TraySetOnEvent ( $About, "_About" )
TraySetOnEvent ( $Hide, "_Hide" )
TraySetOnEvent ( $Exit, "_Exit" )

TraySetState()

;Main Loop
while 1
    sleep(10)
WEnd

;Functions
Func _About()
    TrayTip ( "About", "Made By ZeroZshadoW", 5)
EndFunc

Func _Show($progshow)
        TrayItemDelete(@GUI_CtrlId)
        WinSetState ($progshow,"",@SW_show)
EndFunc

Func _Hide()
    $proghide = inputBox("GoTray","The name of the program to hide",""," ","-1","100","-1","-1")
    if not $proghide = 1 Then
        TraySetOnEvent (assign($proghide,TrayCreateItem($proghide,$List)),"_Show("&$proghide&")")
        WinSetState ($proghide,"",@SW_HIDE)
    EndIf
EndFunc

Func _Exit()
    Exit
EndFunc

p.s. code may suck or not work :) because i haven't but scripting in a long time :evil:


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

Share this post


Link to post
Share on other sites



change your set on events to

TrayItemSetOnEvent ( $About, "_About" )
TrayitemSetOnEvent ( $Hide, "_Hide" )
TrayItemSetOnEvent ( $Exit, "_Exit" )

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

i hate those little errors....


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

Share this post


Link to post
Share on other sites

;GoTray has bin made By ZeroZshadoW
;By idea of mG|tegel

#Include <Constants.au3>
#NoTrayIcon

;Options
;Opt("TrayOnEventMode",1)           <<<-----removed this
Opt("TrayMenuMode",1)
Opt("WinTitleMatchMode",2)
TraySetClick(16)


;Menu
$Hide = TrayCreateItem ( "Hide" )
TrayCreateItem ( "" )
$List = TrayCreateMenu ( "Hidden List" )
TrayCreateItem ( "" )
$About = TrayCreateItem ( "About" )
$Exit = TrayCreateItem ( "Exit" )


;Events
;TraySetOnEvent ( $About, "_About" )    <<< -removed this
;TraySetOnEvent ( $Hide, "_Hide" )
;TraySetOnEvent ( $Exit, "_Exit" )

TraySetState()

;Main Loop
while 1
$msg = TrayGetMsg()             ; <<<<<<--- added this
    Select
    Case $msg = $About
        _About()
    Case $msg = $Hide
        _Hide()
    Case $msg = $Exit
        _Exit()
    EndSelect   
    sleep(10)
WEnd

;Functions
Func _About()
    TrayTip ( "About", "Made By ZeroZshadoW", 5)
EndFunc

Func _Show($progshow)
        TrayItemDelete(@GUI_CtrlId)
        WinSetState ($progshow,"",@SW_show)
EndFunc

Func _Hide()
    $proghide = inputBox("GoTray","The name of the program to hide",""," ","-1","100","-1","-1")
    if not $proghide = 1 Then
        TraySetOnEvent (assign($proghide,TrayCreateItem($proghide,$List)),"_Show("&$proghide&")")
        WinSetState ($proghide,"",@SW_HIDE)
    EndIf
EndFunc

Func _Exit()
    Exit
EndFunc

I prefer to use traygetmsg() / see above tweak

hth

HardCopy :)


Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

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