Hello guys, I'm sorry my bad english ,I am talking through Google translator , your scripts work perfectly , but i can not adapt them to my task :
1. before entering the computer into sleep or hibernation, I want to hear SoundBeep, 750, 500
2. after resuming from sleep or hibernation, I want to hear SoundBeep, 400, 1500
that's all
I have a great working autoit script :
Code: Select all
#RequireAdmin
#pragma compile(Icon, "C:\Program Files (x86)\AutoIt3\Icons\au3script_v9.ico")
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_Run_AU3Check=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <WindowsConstants.au3>
#include<Process.au3>
; <<condition for the transition to sleep>>
Global $PBT_APMSUSPEND = 0x0004
Global $PBT_APMRESUMESUSPEND = 0x0007
$hGUI = GUICreate("Restart", 100, 100, 1, 1)
GUIRegisterMsg($WM_POWERBROADCAST, "Standby")
While 1
Sleep(100)
WEnd
Func Standby($hWnd, $Msg, $wParam, $lParam)
Select
;<<We monitor the transition to sleep>>
Case $wParam = $PBT_APMSUSPEND
Suspend()
; <<monitor output from a sleep>>
Case $wParam = $PBT_APMRESUMESUSPEND
ResumeSuspend()
Case Else
EndSelect
EndFunc
; <<tasks before sleep >>
Func Suspend()
Beep(750, 1000)
EndFunc
; <<tasks after sleep >>
Func ResumeSuspend()
Sleep(500)
Beep(400, 1500)
EndFunc
but I need AHK script ,I do not have enough training , please help , I will be very grateful .