 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
metomeya
Joined: 19 Sep 2004 Posts: 1
|
Posted: Sun Sep 19, 2004 8:10 pm Post subject: Add Laptop option |
|
|
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).
I've looked everywhere for a program to do this. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10464
|
Posted: Sun Sep 19, 2004 8:45 pm Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|