Jump to content

GUI_EVENT_SECONDARYDOWN


Ontosy
 Share

Recommended Posts

It works.

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    Opt("GUIOnEventMode", 1)

    GUICreate("Parent1")
    GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
    GUISetOnEvent($GUI_EVENT_SECONDARYDOWN, "SpecialEvents")


    GUISetState(@SW_SHOW)

    ; Just idle around
    While 1
        Sleep(10)
    WEnd
EndFunc   ;==>Example

Func SpecialEvents()
    Select
        Case @GUI_CtrlId = $GUI_EVENT_CLOSE
            MsgBox($MB_SYSTEMMODAL, "Close Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)

            GUIDelete()
            Exit
        Case @GUI_CtrlId = $GUI_EVENT_SECONDARYDOWN
            MsgBox($MB_SYSTEMMODAL, "Secondary CLICK", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)

    EndSelect
EndFunc   ;==>SpecialEvents

Saludos

Link to comment
Share on other sites

Did you try any debugging and see if SpecialEvents was even getting called?

Func SpecialEvents()
    ConsoleWrite("SpecialEvents called" & @LF)
    Switch (@GUI_CtrlId)
        Case $GUI_EVENT_CLOSE
            MsgBox($MB_SYSTEMMODAL, "Close Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)

            GUIDelete()
            Exit
        Case $GUI_EVENT_SECONDARYDOWN
            MsgBox($MB_SYSTEMMODAL, "Secondary CLICK", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)

    EndSwitch
EndFunc   ;==>SpecialEvents

 

Link to comment
Share on other sites

10 hours ago, Ontosy said:

Why not for me in Windows 10?

I tested in windows 10 x64 . It's ok.

 

Saludos

Link to comment
Share on other sites

The script is same that Danyfirex:

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    Opt("GUIOnEventMode", 1)

    GUICreate("Parent1")
    GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
    GUISetOnEvent($GUI_EVENT_SECONDARYDOWN, "SpecialEvents")
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "SpecialEvents")


    GUISetState(@SW_SHOW)

    ; Just idle around
    While 1
        Sleep(10)
    WEnd
EndFunc   ;==>Example

Func SpecialEvents()
    ConsoleWrite("SpecialEvents called" & @LF)
    Switch (@GUI_CtrlId)
        Case $GUI_EVENT_CLOSE
            MsgBox($MB_SYSTEMMODAL, "Close Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)

            GUIDelete()
            Exit
        Case $GUI_EVENT_PRIMARYDOWN
            MsgBox($MB_SYSTEMMODAL, "Secondary CLICK", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)
        Case $GUI_EVENT_SECONDARYDOWN
            MsgBox($MB_SYSTEMMODAL, "Secondary CLICK", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)

    EndSwitch
EndFunc   ;==>SpecialEvents

I also have same problem in other pc with Win7 x64.

Primary work secondary not.

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