Here are some ideas on the how to physically do it : http://www.instructables.com/topics/how-to-battery-power-a-desktop-pc/ - there are limitations
As for how to make windows see the battery, and monitor it? In essence, pretend to be a laptop. I am not sure, its likely registry settings. I can't find anything about it though.