Jump to content

TrayMenu Problem


Recommended Posts

Hi guys

I made a nice Program that has a nice TrayMenu in it.

The only problem i've got is to Start a Program when the TrayIcon is double clicked. I didn't find something to solve that problem in the Help file. Is there a way to do this? (I need this to simulate an Application and it openes when the TrayIcon is double clicked)

Thanks,

FaNtA

Edit:

I see there's a way to do it with

TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE,"StartProg")

but then i need to rewrite the whole "TrayGetMsg()" Stuff :\

Is there another way?

Edited by XxXFaNtA
Link to comment
Share on other sites

  • Moderators

And

$TrayMsg = TrayGetMsg()
If $TrayMsg = $TRAY_EVENT_PRIMARYDOUBLE Then StartProg()
Doesn't work?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Okay..this works lol..sry :D

Thanks :-*

No problem, I noted it was a pain until I changed the TrayMenuMode to 5.

#include <constants.au3>
Opt('TrayMenuMode', 5)
$Menu = TrayCreateItem('SomeText')
$Exit = TrayCreateItem('Exit')

While 1
    $TrayMsg = TrayGetMsg()
    If $TrayMsg <> 0 Then ConsoleWrite($TrayMsg)
    If $TrayMsg = - 13 Then
        MsgBox(64, 'Info:', 'Double Clicked')
    EndIf
    If $TrayMsg = $Exit Then Exit
    Sleep(10)
WEnd

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...