Sign in to follow this  
Followers 0
sshrum

TrayIcon, right AND left mouse click

4 posts in this topic

Using the beta, I was wondering if it was possible to define right mouse click events AND left mouse click events together. I'd like to do:

> Right click - envokes program main function

> Left click - displays popup menu

The left click popup menu I already have, I'm just getting tired of having to open the popup to subsequently launch my program and would love to just right click the icon to get it to launch.

TIA


Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'

 

Share this post


Link to post
Share on other sites



Using the beta, I was wondering if it was possible to define right mouse click events AND left mouse click events together. I'd like to do:

> Right click - envokes program main function

> Left click - displays popup menu

The left click popup menu I already have, I'm just getting tired of having to open the popup to subsequently launch my program and would love to just right click the icon to get it to launch.

TIA

You could use _ispressed, see example

#Include <Misc.au3>


While 1
if _IsPressed(01) Then
MsgBox(4096,"","Left mouse button pressed")
ElseIf _IsPressed(02) Then
MsgBox(4096,"","Right mouse button pressed")
EndIf
WEnd


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

@ sshrum

> Right click - envokes program main function

> Left click - displays popup menu

To get the right click working with the traymenu you will need:

TraySetClick (1) This tell AutoIt what mouseclicks will shown the tray menu in our case left click.

Then on your select statement:

$msg = TrayGetMsg()

Select

Case $msg = $TRAY_EVENT_SECONDARYDOWN This tell AutoIt when the right click is down.

MsgBox(0, '', 'Right click press')

Hope this will help...


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

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