Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Running commands on standby, hibernation and resume events


  • Please log in to reply
24 replies to this topic
bitcloud
  • Members
  • 29 posts
  • Last active: Feb 20 2010 04:03 AM
  • Joined: 30 Oct 2008
I'm having trouble with this too... I wonder if it works in vista?

Toby
  • Members
  • 10 posts
  • Last active: Mar 31 2009 07:47 PM
  • Joined: 07 Jun 2005
Great, thanks!

Can anybody help, how to extend the script to run on locking of windows as well?

lenz
  • Members
  • 1 posts
  • Last active: Apr 16 2010 04:17 PM
  • Joined: 16 Apr 2010
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

TheStarGate
  • Members
  • 1 posts
  • Last active: Jul 14 2011 12:29 PM
  • Joined: 30 Apr 2010

....
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 -->

Just use the command again and the volume will be unmuted.


TheStarGate

ian914
  • Guests
  • Last active:
  • Joined: --
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:

#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
}

I'm using AutoHotkey version 1.0.48.05 on Windows 7.

Z_Gecko
  • Guests
  • Last active:
  • Joined: --

#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
}


shin
  • Guests
  • Last active:
  • Joined: --
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

pocketrocket
  • Guests
  • Last active:
  • Joined: --
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

fragman
  • Members
  • 1591 posts
  • Last active: Nov 12 2012 08:51 PM
  • Joined: 13 Oct 2009
Going to the main page of this domain and downloading AutoHotkey might help... ;)

CoolMagma
  • Members
  • 1 posts
  • Last active: Sep 17 2013 07:19 AM
  • Joined: 17 Sep 2013
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