AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Running commands on standby, hibernation and resume events
Goto page Previous  1, 2
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
bitcloud



Joined: 30 Oct 2008
Posts: 27

PostPosted: Sat Jan 16, 2010 12:54 pm    Post subject: Reply with quote

I'm having trouble with this too... I wonder if it works in vista?
Back to top
View user's profile Send private message
Toby



Joined: 07 Jun 2005
Posts: 10

PostPosted: Sat Feb 13, 2010 7:23 pm    Post subject: Reply with quote

Great, thanks!

Can anybody help, how to extend the script to run on locking of windows as well?
Back to top
View user's profile Send private message
lenz



Joined: 16 Apr 2010
Posts: 1

PostPosted: Fri Apr 16, 2010 4:21 pm    Post subject: Re: bitcloud Reply with quote

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:

http://www.autohotkey.com/docs/commands/SoundSet.htm


Cheers
Back to top
View user's profile Send private message
TheStarGate



Joined: 30 Apr 2010
Posts: 1

PostPosted: Fri Apr 30, 2010 11:13 am    Post subject: Re: bitcloud Reply with quote

lenz wrote:
....
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:

http://www.autohotkey.com/docs/commands/SoundSet.htm

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


TheStarGate
Back to top
View user's profile Send private message
ian914
Guest





PostPosted: Sat Jul 03, 2010 1:16 am    Post subject: Reply with quote

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:
Quote:

#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.
Back to top
Z_Gecko
Guest





PostPosted: Sat Jul 03, 2010 6:00 am    Post subject: Reply with quote

Quote:
Code:
#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
}


Code:
#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, "onSuspend")
return

onSuspend(wParam, lParam)
{
if (wParam = 7 OR wParam = 8)
Send #6
Return
}
Back to top
shin
Guest





PostPosted: Sun Nov 07, 2010 7:37 pm    Post subject: Reply with quote

And in WM_POWERBROADCAST there is the

PBT_POWERSETTINGCHANGE
identifier -> 32787 (0x8013)


but how to use it?


some info...
http://msdn.microsoft.com/en-us/library/ms703398.aspx
Back to top
pocketrocket
Guest





PostPosted: Wed May 04, 2011 4:19 pm    Post subject: What language? Reply with quote

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
Back to top
fragman



Joined: 13 Oct 2009
Posts: 1199

PostPosted: Wed May 04, 2011 4:55 pm    Post subject: Reply with quote

Going to the main page of this domain and downloading AutoHotkey might help... Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group