I implement this function : GetSystemPowerStatusEx & GetSystemPowerStatusEx2
according to this article on MSDN, I should create a class named according to the fu
Put them inside the class you are going to use them as a static methods, then wrap around them with normal methods so you won't bother the rest of the application with the notion that there is something extern involved.
I use that approach and it never fails.
EDIT:
Check this out:
http://pinvoke.net/search.aspx?search=GetSystemPowerStatusEx