Detect when your laptop closes.

  1. #1
    metomeya is offline Newbie

    Detect when your laptop closes.

    I'm not a programmer, but I was wondering if it would be possible for someone to make a little background program that would put my computer to lockdown when I closed the lid on my laptop computer?

    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 savers passwords, or the win + L. And the option isn't under window's power control options. Only standby is.

    I've looked everywhere for a program, or someway to do this, your my only hope.


  2. #2
    DJNafey is offline UK site moderator
    I'm not suggesting you do it permanently but have you tried the Standby / Hibernate options to see if they work when you close the lid? If there's no sensor in your laptop that can activate those settings, then no-one would be able to write a program to do it as there would be nothing to trigger it automatically.

  3. #3
    DJNafey is offline UK site moderator
    Incidentally, I would be surprised if anyone here knew how to program something like that ......... but you never know ........

  4. #4
    metomeya is offline Newbie
    sorry i copy and pasted from a programming forums i posted that message to. I meant to say is there a program, or is there a way to do that.

    yes there is a sensor, cause I do have the standby option when I close my lid. Only standby cuts my internet connection, and any downloads i'm doing.

  5. #5
    metomeya is offline Newbie
    Isn't there a driver for that sensor? Is there anyway to find that driver software?

  6. #6
    metomeya is offline Newbie
    It's possible if you follow this link

    http://msdn.microsoft.com/library/de...ad0ec4.xml.asp

    talks about detecting the lid close state "PO_CB_LID_SWITCH_STATE − Indicates that the lid switch has changed states"

    But you need to write a driver that would detect it and send it to a program

+ Reply to Thread