GodlessSinner Posted July 23, 2009 Share Posted July 23, 2009 (edited) How to GUICtrlSetData($Label1,GUICtrlRead($Label1)+1) by scrolling MouseWheel? (UP: -1 | Down: +1)#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Example", 269, 118, 451, 501) $Label1 = GUICtrlCreateLabel("100", 80, 40, 101, 28, $SS_CENTER) GUICtrlSetFont(-1, 15, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndAnd how to:If Single Click on TrayIcon then msgbox(0,"","Single click") ElseIf Double Click on TrayIcon then msgbox(0,"","Double click") EndIf(it's for simplicity of understanding) Edited July 23, 2009 by Vitas _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
GodlessSinner Posted July 23, 2009 Author Share Posted July 23, 2009 First question is already solved, but the second i can't. Help! _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
furrycow Posted July 23, 2009 Share Posted July 23, 2009 This ones straight from the help file: #include <Constants.au3> #NoTrayIcon Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown. $exit = TrayCreateItem("Exit") TrayItemSetOnEvent(-1,"ExitEvent") TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE,"SpecialEvent") TraySetOnEvent($TRAY_EVENT_SECONDARYUP,"SpecialEvent") TraySetState() While 1 Sleep(10) ; Idle loop WEnd Exit ; Functions Func SpecialEvent() Select Case @TRAY_ID = $TRAY_EVENT_PRIMARYDOUBLE Msgbox(64,"SpecialEvent-Info","Primary mouse button double clicked.") Case @TRAY_ID = $TRAY_EVENT_SECONDARYUP Msgbox(64,"SpecialEvent-Info","Secondary mouse button clicked.") EndSelect EndFunc Func ExitEvent() Exit EndFunc or search traysetonevent in the help file Instant Lockerz Invite - www.instantlockerzinvite.co.uk Link to comment Share on other sites More sharing options...
GodlessSinner Posted July 23, 2009 Author Share Posted July 23, 2009 (edited) This ones straight from the help file:- Yes, I seen it, and modify to this: #include <Constants.au3> #NoTrayIcon Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown. $exit = TrayCreateItem("Exit") TrayItemSetOnEvent(-1,"ExitEvent") TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE,"SpecialEvent") TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN,"SpecialEvent") TraySetClick (16) TraySetState() While 1 Sleep(10) ; Idle loop WEnd Exit Func ExitEvent() Exit EndFunc Func SpecialEvent() Select Case @TRAY_ID = $TRAY_EVENT_PRIMARYDOUBLE MsgBox(0,"","double") Case @TRAY_ID = $TRAY_EVENT_PRIMARYDOWN MsgBox(0,"","single") EndSelect EndFunc When you double click in tray, you will see MsgBox(0,"","single") and then MsgBox(0,"","double"). How to divide it?? Edited August 2, 2009 by Vitas _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
GodlessSinner Posted August 2, 2009 Author Share Posted August 2, 2009 I repeat a question.. _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
Authenticity Posted August 2, 2009 Share Posted August 2, 2009 Func SpecialEvent() Select Case @TRAY_ID = $TRAY_EVENT_PRIMARYDOUBLE AdlibDisable() MsgBox(0,"","double") Case @TRAY_ID = $TRAY_EVENT_PRIMARYDOWN AdlibEnable('_Adlib', 150) EndSelect EndFunc Func _Adlib() AdlibDisable() MsgBox(0, "", "single") EndFuncYou can call GetDoubleClickTime to determine the interval in ms that a click event should be considered a single click. Link to comment Share on other sites More sharing options...
GodlessSinner Posted August 2, 2009 Author Share Posted August 2, 2009 (edited) Authenticity, it works, but if you click once, and then when you seen MsgBox("Single"), quickly clicks once again, you will see MsgBox("Double"), that's why code must be looks like this: Glogal $adlib = False Func SpecialEvent() Select Case @TRAY_ID = $TRAY_EVENT_PRIMARYDOUBLE If $adlib = True Then AdlibDisable() ConsoleWrite("Double!" & @CR) EndIf Case @TRAY_ID = $TRAY_EVENT_PRIMARYDOWN $adlib = True AdlibEnable('_Adlib', 150) EndSelect EndFunc Func _Adlib() AdlibDisable() ConsoleWrite("Single" & @CR) $adlib = False EndFunc Thanks to all! Edited August 2, 2009 by Vitas _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
GodlessSinner Posted August 26, 2009 Author Share Posted August 26, 2009 Two qustions: - How to get WinList? (not of all - only such as you press ALT-TAB) - How to shutdown PC if there are no-saved documents? (without WinGetTitle, sending CTRL-S to each window, - just ignore all messages and terminate machine) thanks. _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
GodlessSinner Posted August 28, 2009 Author Share Posted August 28, 2009 bump! _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
WolfWorld Posted August 28, 2009 Share Posted August 28, 2009 See WinGetState Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! Link to comment Share on other sites More sharing options...
jvanegmond Posted August 28, 2009 Share Posted August 28, 2009 Two qustions: - How to get WinList? (not of all - only such as you press ALT-TAB) Straight from help file, includes _IsVisible check. Enjoy. $var = WinList() For $i = 1 to $var[0][0] ; Only display visble windows that have a title If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1]) EndIf Next Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc github.com/jvanegmond 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