I had same problem with my HP notebook and after a few trips to the service center the problem persisted, they said its a software problem with Vista. After a lot of googling this is what worked for me:

1.Click Start and type device in the search field, then select Device Manager .

2.Expand the Batteries category.

3.Under the Batteries category, right-click the Microsoft ACPI Compliant Control Method Battery listing, and select Uninstall .

WARNING: Do not remove the Microsoft AC Adapter driver or any other ACPI compliant driver.

4.On the Device Manager taskbar, click Scan for hardware changes .

Alternately, select Action > Scan for hardware changes .

Windows will scan your computer for hardware that doesn't have drivers installed, and will install the drivers needed to manage your battery's power. The notebook should now indicate that the battery is charging."