Jump to content

Recommended Posts

Posted (edited)

i want to create a tray menu where i will store some information

hotkeyset("!{F6}", "_hide")

global $showHidden=0,$e[200], $x=1 , $pan[200]


$hiddenWindows = TrayCreatemenu("Hidden windows")
TrayCreateItem("")
$exit  = TrayCreateItem("Exit")

while 1
$traymsg=TrayGetMsg()

if $traymsg=$pan[*]

wend

func _hide()
$e[$x]=WinGetTitle ( "[ACTIVE]" ,"" )   
WinSetState ($e[$x], "", @SW_HIDE )
$pan[$x]=TrayCreateItem($e[$x],$hiddenwindows)
    $x=$x+1 
    endfunc

Now what i want to do is to recognize each created Tray menu item so when pressed, that window hides again.

I don't want to write manually every time

case $pan[1]

case $pan[2]

and ect.

I don't need a full fixed script, just a solution how can i make it work.

Thanks

Edited by second
Posted

You can make $pan[0] the number of tray items you have. Then you can use something like this:

For $i = 1 To $pan[0]
    ConsoleWrite(TrayItemGetText($pan[$i]) & @CRLF)
Next
Posted

Thanks, and what about recognizing the items? i tried to put it in a loop( for, to) and it keeps giving me that's traymsg=pan[$x] every time

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
×
×
  • Create New...