I found an article in MSDN which describe how to do some certain thing, http://msdn.microsoft.com/en-us/library/ms919833.aspx but it is in c++. I want to translate or re-use it in c#.net, is there a way to use the function in the document above?
It sems that function you link to -- RequestPowerNotifications -- is not so easy to deal with from C# as it is Message Queue based. But luckily someone has written a couple of articles explaining how to do it!