Jump to content

TrayMenu is not working when compiled


Sypher
 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

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