Ontosy Posted February 20, 2016 Share Posted February 20, 2016 Why when use GUISetOnEvent($GUI_EVENT_SECONDARYDOWN, "SpecialEvents" not work? for example this. Link to comment Share on other sites More sharing options...
Danyfirex Posted February 20, 2016 Share 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 Link to comment Share on other sites More sharing options...
Ontosy Posted February 21, 2016 Author Share Posted February 21, 2016 Why not for me in Windows 10? Link to comment Share on other sites More sharing options...
InunoTaishou Posted February 21, 2016 Share 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 Link to comment Share on other sites More sharing options...
Ontosy Posted February 21, 2016 Author Share 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 Link to comment Share on other sites More sharing options...
Danyfirex Posted February 21, 2016 Share 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 Link to comment Share on other sites More sharing options...
Ontosy Posted February 21, 2016 Author Share Posted February 21, 2016 Why not work for me? Link to comment Share on other sites More sharing options...
AutoBert Posted February 21, 2016 Share Posted February 21, 2016 Show your script, Danyfirex script works for me on Win10 x64 Link to comment Share on other sites More sharing options...
Ontosy Posted February 22, 2016 Author Share 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. Link to comment Share on other sites More sharing options...
AutoBert Posted February 22, 2016 Share 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 Link to comment Share on other sites More sharing options...
Ontosy Posted February 22, 2016 Author Share 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. Link to comment Share on other sites More sharing options...
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