AndreyS Posted September 4, 2017 Share Posted September 4, 2017 Jos suggested in one of the themes the following code: #include <WindowsConstants.au3> #include <GUIConstants.au3> #include <Date.au3> Global $PBT_APMSUSPEND = 0x0004 Global $PBT_APMRESUMESUSPEND = 0x0007 Global $PBT_APMSTANDBY = 0x0005 Global $PBT_APMRESUMESTANDBY = 0x0008 Dim $hGUI = GUICreate("Test", 100, 100,1,1) ;You need to work without this line. GUIRegisterMsg($WM_MOUSEWHEEL, "Standby") Func Standby($hWnd, $Msg, $wParam, $lParam) ConsoleWrite(_NowTime() & ": " & $wParam & @LF) Select Case $wParam = $PBT_APMSUSPEND ConsoleWrite(" You going into Suspend." & @LF) Case $wParam = $PBT_APMRESUMESUSPEND ConsoleWrite(" You just woke up from Suspend." & @LF) Case $wParam = $PBT_APMSTANDBY ConsoleWrite(" You are going into Standby." & @LF) Case $wParam = $PBT_APMRESUMESTANDBY ConsoleWrite(" You just woke up from Standby." & @LF) Case Else EndSelect EndFunc My application does not use any windows. It has only a menu in the tray. Tell me, who knows how to make this code work in my case. Thank you! Link to comment Share on other sites More sharing options...
Developers Jos Posted September 5, 2017 Developers Share Posted September 5, 2017 Just use the code anyways and leave the GUI hidden ? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
AndreyS Posted September 5, 2017 Author Share Posted September 5, 2017 Well, yes, it's like an option to make a small window and not display it. But I thought there is still a code more suitable for my situation and more correct in terms of programming. I'm very grateful to you, Jos, that you responded immediately! 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