Creating software that can run on a Surface, inquired how to capture in the process of software running long power button press and press events? The current single press the power button to enter the sleep state, long press the power button to enter to ask if shutdown interface, I want to reach the purpose of the is: 1. In a single after pressing the power button, the computer to sleep before do some processing, 2. After the long press the power button, enter the asked if shutdown do some processing before,