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 

Add Laptop option

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
metomeya



Joined: 19 Sep 2004
Posts: 1

PostPosted: Sun Sep 19, 2004 8:10 pm    Post subject: Add Laptop option Reply with quote

It is possible for a AutoHotkey detect when the lid of my laptop closes?
And then launch a command when it does? or is there any program that you know that can do that for me?

Here is the command i wanted executed.

rundll32 user32.dll LockWorkStation



Note: Before anyone gives other options I do not want to use standby, hibernate, screen saver's password, or the win + L. And the option isn't under window's power control options (standby is it's only option with returning to the lock screen). Crying or Very sad

I've looked everywhere for a program to do this.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Sun Sep 19, 2004 8:45 pm    Post subject: Reply with quote

Does anything in particular happen when you close it? If so, you be able to detect the change by looking at the change (if any) in a variable such as USERNAME, A_Cursor, A_IsAdmin, or A_IPAddress1. If a certain window appears/disappears when you do it, you could use IfWin[Not]Exist to check for that.

If you would want to lock the workstation after a certain period of inactivity, you could have a script periodically check the value of A_TimeIdlePhysical.

If the above doesn't help, the solution probably involves creating a program to query the system's power properties, which I know little about.

By the way, isn't Win-L the same effect as "rundll32 user32.dll LockWorkStation" (on XP at least)? If so, what you're really trying to do is avoid having to remember to press Win-L when closing the lid?
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
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