Fog Creek Software
g
Discussion Board




Laptop Security

Ok, here´s the idea: I'm gonna make a program that plays a really loud sound, like a siren, if my laptop is locked and someone unplugs the power chord. I know this isn´t gonna stop smart thieves and there´s nothing to stop them from just turning off the sound as soon as they hear it but the idea is that the loud sound will scare them off or someone will hear it and go see what's going on. I´m in university and some laptops have been stolen from here so I´m a bit worried.

So here's my question: How can I catch the signal that tells the computer that the power chord has become unplugged?

Laptop User
Friday, November 14, 2003

Why not just buy one of those locks that let you lock your laptop to a convenient heavy object? Breaking that would also require a while and draw attention, and then no embarrassing false alarms that make everyone in the computer lab despise you.

Exception guy
Friday, November 14, 2003

Indeed -- look for the little hole which is about 3mm by 7mm which is designed for plugging one of these into http://www.microsaver.com/html/2220.html

Duncan Smart
Friday, November 14, 2003

A laptop with one of those little wire security systems was stolen from a place I used to work... the 23rd floor of a high rise owned by the company I worked for. Someone, it seems, sawed through the wire during the overnight period, despite the metal detectors and x-ray machines.

www.MarkTAW.com
Friday, November 14, 2003

Actually there is at least one external laptop alarm already on the market that makes a very loud sound (louder than your laptop speakers could make, I believe) when the laptop is moved. It plugs into the security lock slot.

Brad
Friday, November 14, 2003

Um, after a quick Google search, make that "there are at least twenty bazillion" laptop alarms on the market today. Just do a search for "laptop security" or "laptop alarm" or "notebook alarm" and you'll find quite a range of choices available. These things all emit a loud noise when the laptop is moved, or when it strays too far from you if you're holding a homing device.

Brad
Friday, November 14, 2003

Yeah, I know you can buy them but I want to program it. Also just for the practice, I´m studying computer science. Anyone know how to catch the 'unplug' signal?

Laptop User
Friday, November 14, 2003

You could start here:
http://msdn.microsoft.com/library/en-us/power/base/system_power_management_events.asp

"System Power Status Events: A system power status event occurs when there is a change in the power supply or in the system battery status. For example, the system broadcasts a PBT_APMPOWERSTATUSCHANGE event whenever the user switches from battery to AC power or vice versa."

Philip Dickerson
Friday, November 14, 2003

Or, for a simpler approach, you could just periodically call the GetSystemPowerStatus function:
http://msdn.microsoft.com/library/en-us/power/base/getsystempowerstatus.asp
"The GetSystemPowerStatus function retrieves the power status of the system. The status indicates whether the system is running on AC or DC power, whether the battery is currently charging, and how much battery life remains."

Philip Dickerson
Friday, November 14, 2003

I love it.

(guy steals laptop)

laptop: Put me down
guy: Who said that?
laptop: I did, put me down
guy: A talking laptop?
laptop: Better believe it, now put me down gently before I redirect power from the dilithium chambers and super charge my outer hull, electrocuting you and searing your flesh.
guy: What?
laptop: Just do it!
guy: Okay okay. Geeze, I think I'll go back to pirating software
laptop: That's a bad idea too, buddy. If I catch you doing anything illegal again I'll activate the homing device I've just implanted under your skin and the police will find you.
guy: Damn you Bill Gates !!!!!

www.MarkTAW.com
Friday, November 14, 2003

Good Luck laptop user.

I have a nagging suspicion that your alarm thingy will be more trouble than good.

I can think of so many scenarios where it gets set off accidentally. Power cut, someone kicks cable, you are connected, and friend wants to use power socket for something else.... I could go on.

When folk figure out how it works, any thief would first remove battery (pretty easy on most laptops) before disconnecting it.

Your method will only work if you laptop is locked, and plugged in. How do you run your laptop off the mains and in a public area. Besides the computer lab, there's two kinds of places I can think of; Library, and coffeeshop. Either way, they won't be too chuffed if your alarm accidentally goes off.

How will you reset the alarm once it goes off. It could be a while between the alarm going off, and you waking your machine up. More pissed off neighbours.

Tapiwa
Friday, November 14, 2003

Google for "Briefcase Alarm".  Most of these attach the alarm to the case and give you a monitor.  You and the monitor get more than "X" feet apart and the alarm on the briefcase goes off.

It would be interesting to see what would happen if this occurred in an airport.

MSHack
Friday, November 14, 2003

Thanks Philip, I looked at that and it is what I was looking for.  I realize that this alarm probably isn't gonna help me much and a hardware thingy which makes sound is gonna be much more useful, but hey, I´m studying for my exams and need a pet project to do between studying Big O notations and binary trees.

One more question, can anyone tell me how I know if the computer's locked or not? thanx.

LaptopUser
Friday, November 14, 2003

I would not think it that good an idea to have the laptop permantly on mains power anyway. At the very least you're running the risk of burning yourself when you pick it up (and putting it on your lap doesn't bear thinking of) and at the worst you might cause a fire that destroys the whole building.

Stephen Jones
Saturday, November 15, 2003

I could set fire to the building...

Milton
Saturday, November 15, 2003

huh? my laptop is plugged in 99.5% of the time. it's a nice small computer which takes up very little space in my apartment.
my older laptop is unplugged right now, but if I want to use it, well, the battery died years ago.

mb
Sunday, November 16, 2003

There have been cases of fires caused by laptops or the transformers overheating. I've just felt my transformer now, and while not hot enough to burn it is still pretty hot to touch.

Stephen Jones
Sunday, November 16, 2003

You need a metallic laptop, like an Apple, then just run loads of current through it so the would-be thief is electrofried.

You'd need some sort of device to disarm the current, maybe based on proximity.

Rhys Keepence
Sunday, November 16, 2003

*  Recent Topics

*  Fog Creek Home