Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#2233 closed Bug (No Bug)

TraySetOnEvent does not set $TRAY_EVENT_PRIMARYDOWN properly

Reported by: MrCreatoR <mscreator@…> Owned by:
Milestone: Component: AutoIt
Version: 3.3.8.1 Severity: None
Keywords: Cc:

Description

Check this example:

#NoTrayIcon
#include <Constants.au3>

Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode", 1+2) ; Default tray menu items (Script Paused/Exit) will not be shown.

TrayCreateItem("Exit")
TrayItemSetOnEvent(-1, "ExitEvent")

TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, "SpecialEvent")
TraySetOnEvent($TRAY_EVENT_PRIMARYUP, "SpecialEvent")
TraySetState()
TraySetClick(16)

While 1
    Sleep(10) ; Idle loop
WEnd

Func SpecialEvent()
    Switch @TRAY_ID
        Case $TRAY_EVENT_PRIMARYDOWN
            MsgBox(64, "SpecialEvent-Info", "Primary mouse button pressed down.")
        Case $TRAY_EVENT_PRIMARYUP
            MsgBox(64, "SpecialEvent-Info", "Primary mouse button clicked.")
    EndSwitch
EndFunc

Func ExitEvent()
    Exit
EndFunc

Both MsgBoxes shown after we release primary mouse button.
Expected behavior is that first MsgBox should be shown after we hold down primary mouse button, and second after we release the button.

Attachments (0)

Change History (2)

comment:1 Changed 7 years ago by trancexx

  • Resolution set to No Bug
  • Status changed from new to closed

It's windows thing.
WM_LBUTTONDOWN message is send back to us after explorer confirms you are not trying to initiate drag operation. That happens right before you release the button if no mouse move happened in the meantime.
Therefore no bug.

comment:2 Changed 7 years ago by MrCreatoR <mscreator@…>

Then why we need this event, i think it should be removed.
Or replace it with $TRAY_EVENT_DRAGBEGIN/END events.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.