Search the Community
Showing results for tags 'hibernate'.
Found 2 results
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!
I have a script that monitors network up/down time and when my laptop is set to hibernate or sleep, then later started up again, my script counts all of the hibernate/sleep time as down time. If I could get notification when going into hibernate/sleep mode and when it resumes normal mode, I could stop looking until normal mode is resumed. Is there an API that does this, or perhaps an event I could register a handler for? Andy