Ontosy Posted February 20, 2016 Posted February 20, 2016 Why when use GUISetOnEvent($GUI_EVENT_SECONDARYDOWN, "SpecialEvents" not work? for example this.
Danyfirex Posted February 20, 2016 Posted February 20, 2016 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 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
InunoTaishou Posted February 21, 2016 Posted February 21, 2016 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
Ontosy Posted February 21, 2016 Author Posted February 21, 2016 (edited) added $GUI_EVENT_PRIMARYDOWN: $GUI_EVENT_CLOSE and $GUI_EVENT_PRIMARYDOWN called. $GUI_EVENT_SECONDARYDOWN not called. Edited February 21, 2016 by Ontosy
Danyfirex Posted February 21, 2016 Posted February 21, 2016 10 hours ago, Ontosy said: Why not for me in Windows 10? I tested in windows 10 x64 . It's ok. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
AutoBert Posted February 21, 2016 Posted February 21, 2016 Show your script, Danyfirex script works for me on Win10 x64
Ontosy Posted February 22, 2016 Author Posted February 22, 2016 The script is same that Danyfirex: expandcollapse popup#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.
AutoBert Posted February 22, 2016 Posted February 22, 2016 This script also working, but you forgot to edit line 32 to display the right message. May be some app is hooking your mouse and destroy the event? Did your secondary mousebutton work in other applications? Ontosy 1
Ontosy Posted February 22, 2016 Author Posted February 22, 2016 I have fixed line 32. secondary mousebutton work in other applications but i have found that it also have conflict with other application. ty.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now