I'm having trouble with this too... I wonder if it works in vista?
![Photo](https://secure.gravatar.com/avatar/f64e67b1f851a49887469951f817cfe2?s=100&d=%2F%2Fwww.autohotkey.com%2Fboard%2Fpublic%2Fstyle_images%2Fortem%2Fprofile%2Fdefault_large.png)
Running commands on standby, hibernation and resume events
Started by
RobOtter
, Aug 02 2007 09:07 AM
24 replies to this topic
#16
-
Posted 16 January 2010 - 12:54 PM
![Running commands on standby, hibernation and resume events: post #16](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
Great, thanks!
Can anybody help, how to extend the script to run on locking of windows as well?
Can anybody help, how to extend the script to run on locking of windows as well?
#17
-
Posted 13 February 2010 - 07:23 PM
![Running commands on standby, hibernation and resume events: post #17](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
I couldn't get it to work in Windows 7, and debugging it I figuered the SoundSet didn't work. I looked up the command and they say that SoundSet doesn't work for Vista and above.
However they provide two solutions:
1) Run the script in Xp compatability mode
2) Replace the SoundSet muter with a "keystroke" mute.
I generally like to avoid compatability modes, so I went with the keystroke approach.
To mute, therefore, replace all "SoundSet, 1..." lines with:
Send {Volume_Mute}
I don't want my computer to unmute on restart so I don't care to know how to unmute it automatically.
For more info:
<!-- m -->http://www.autohotke...ds/SoundSet.htm<!-- m -->
Cheers
However they provide two solutions:
1) Run the script in Xp compatability mode
2) Replace the SoundSet muter with a "keystroke" mute.
I generally like to avoid compatability modes, so I went with the keystroke approach.
To mute, therefore, replace all "SoundSet, 1..." lines with:
Send {Volume_Mute}
I don't want my computer to unmute on restart so I don't care to know how to unmute it automatically.
For more info:
<!-- m -->http://www.autohotke...ds/SoundSet.htm<!-- m -->
Cheers
#18
-
Posted 16 April 2010 - 04:21 PM
![Running commands on standby, hibernation and resume events: post #18](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
Just use the command again and the volume will be unmuted.....
Send {Volume_Mute}
I don't want my computer to unmute on restart so I don't care to know how to unmute it automatically.
For more info:
<!-- m -->http://www.autohotke...ds/SoundSet.htm<!-- m -->
TheStarGate
#19
-
Posted 30 April 2010 - 11:13 AM
![Running commands on standby, hibernation and resume events: post #19](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
I want my computer to send some key presses when I resume or go into sleep mode. So I modeled a script after this one, but it's not functioning:
I'm using AutoHotkey version 1.0.48.05 on Windows 7.#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
OnMessage(0x218, "WM_POWERBROADCAST")
return
onSuspend(wParam, lParam)
{
if (wParam = 7 OR wParam = 8)
Send #6
Return
}
#20
-
Posted 03 July 2010 - 01:16 AM
![Running commands on standby, hibernation and resume events: post #20](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. OnMessage(0x218, "[color=red]WM_POWERBROADCAST[/color]") return [color=red]onSuspend[/color](wParam, lParam) { if (wParam = 7 OR wParam = 8) Send #6 Return }
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. OnMessage(0x218, "[color=green]onSuspend[/color]") return [color=green]onSuspend[/color](wParam, lParam) { if (wParam = 7 OR wParam = 8) Send #6 Return }
#21
-
Posted 03 July 2010 - 06:00 AM
![Running commands on standby, hibernation and resume events: post #21](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
And in WM_POWERBROADCAST there is the
PBT_POWERSETTINGCHANGE
identifier -> 32787 (0x8013)
but how to use it?
some info...
http://msdn.microsof...y/ms703398.aspx
PBT_POWERSETTINGCHANGE
identifier -> 32787 (0x8013)
but how to use it?
some info...
http://msdn.microsof...y/ms703398.aspx
#22
-
Posted 07 November 2010 - 07:37 PM
![Running commands on standby, hibernation and resume events: post #22](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
Is this a script or something I need to compile?
Compiler or interpreter name to use?
C, C++, C#, Java, Python, DOS .bat or .cmd?
sorry - there are so many choices
thanks
Linda
Compiler or interpreter name to use?
C, C++, C#, Java, Python, DOS .bat or .cmd?
sorry - there are so many choices
thanks
Linda
#23
-
Posted 04 May 2011 - 04:19 PM
![Running commands on standby, hibernation and resume events: post #23](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
Going to the main page of this domain and downloading AutoHotkey might help...
![;)](http://www.autohotkey.com/board/public/style_emoticons/default/wink.png)
#24
-
Posted 04 May 2011 - 04:55 PM
![Running commands on standby, hibernation and resume events: post #24](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
looks cool,
but I don't understand how to use, it seems VBScript (is it?) I've tryed to save in .vbs file and run it, but dosen't works
how can I make it works?
thanks
#25
-
Posted 17 September 2013 - 07:19 AM
![Running commands on standby, hibernation and resume events: post #25](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)