Don't ask how to hack password. (BIOS Passwords)
#19284 by tgilbert
Wed Sep 03, 2003 3:42 pm
I am writing a program for Windows 95/98/ME/NT/2000/XP in C++. It is important for the program to know whether the computer that is executing the code is a laptop or a desktop. I have been researching for a while various ways to determine and thought that perhaps the presence of a battery would identify 99% of laptop users. (Other thoughts was the presence of a ISA bus, and BIOS)

I tried using the function GetSystemPowerStatus() to determine if a battery is present, but the function relies on the software in Windows being properly configured. I.e. if the power management isn't setup, it will return that a laptop doesn't have a battery, and is running on A/C even when undocked, and unplugged from the electricity.

I was hopeing that there was another way to do this. Is anyone aware of a programatic way to determine if the BIOS is built for a Laptop or build for a Desktop? Or for that matter, does anyone else have any other suggestions?