Sign in to follow this  
Followers 0
Sypher

TrayMenu is not working when compiled

5 posts in this topic

#1 ·  Posted (edited)

Hey,

In a script i am using a traymenu with 2 items, seperated with a.. seperator.

#NoTrayIcon
#include <Constants.au3>
<snip>
Opt("TrayAutoPause", 0)
Opt("RunErrorsFatal", 0)
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode",1)
<snip>
TrayItemSetOnEvent(TrayCreateItem("Start"), "_Start")
TrayCreateItem("")
TrayItemSetOnEvent(TrayCreateItem("Stop"), "_Stop")
TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "_Start")
TraySetState()

When i'm running it under SciTE, it works great. Left click, right click, double click.

But when its compiled (under beta or stable, doesn't matter) the right- nor leftclick works!

Only the doubleclicking works.

I've seen this on a few computers i've tested it on, but on my own it's working..

The code should be ok, so what can be the problem?

I tried compiling the code stated in the manual, but this isn't working either!

Thanks in advance!

Edited by Sypher

Share this post


Link to post
Share on other sites



Still not working..

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

This works for me compiled:

#NoTrayIcon
#include <Constants.au3>

Opt("TrayAutoPause", 0)
Opt("RunErrorsFatal", 0)
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)

TrayItemSetOnEvent(TrayCreateItem("Start"), "_Start")
TrayCreateItem("")
TrayItemSetOnEvent(TrayCreateItem("Stop"), "_Stop")
TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "_Dbl")
TraySetState()

Func _Dbl()
    MsgBox(0, '', '_Dbl')
EndFunc

Func _Start()
    MsgBox(0, '', '_Start')
EndFunc

Func _Stop()
    MsgBox(0, '', '_Stop')
    Exit
EndFunc

While 1
    Sleep(100)
WEnd

You could try removing the event part out of the creation part, and see if that helps, like...

TrayCreateItem("Start")

TrayItemSetOnEvent(-1, "_Start")

etc

Edited by xcal

Share this post


Link to post
Share on other sites

Just tried your code, it works compiled but it doesn't work when put in my app...

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