You might also see if GetSystemPowerStatus might be simpler...
If the API calls do not need a HWND parameter, then you can probably use them without creating any windows. (within reason...)
Code:
#include <windows>
int main() {
SYSTEM_POWER_STATUS sps;
GetSystemPowerStatus(&sps);
}
I say to use getsystempowerstatus because in order to use CallNtPowerInformation you have to include another header and a library file as dictated in the requirements section of this page ->
http://msdn2.microsoft.com/en-US/library/aa372675.aspx