That's a bad thing to happen when the power is up and should be treated as a catastrophic event. As an electronics designer, not many laptops supported "hot plug" on the battery. So all this means is that you need to repair that laptop.
Subject too long for current field.
So I have a Dell Precision M4600 running Windows 7. Whenever its plugged into the wall or docking station, if the battery drops out, it shuts down immediately as if I don't have it plugged into the wall. Windows does tell me that its plugged in. The battery charges fine as I have unplugged the laptop and used it off the battery. So those are indicators that it is receiving power through the plug.
So why should it power off if the battery gets disconnected?
Yes the battery is loose and right now I have duct tape holding it in.

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic