<p>How can I prevent the pocket PC device from shutting down from my application when the power button pressed? I am using C#.</p>

You can try changing the power requirements for the device "BLK1:", which is the blacklight device. Be aware that the behavior may not be the same on all devices and version of the OS or Vendor specific Extensions.
To do this, you can write something like :
```
```
[DllImport("coredll")]
    private extern static IntPtr SetPowerRequirement(string pvDevice, int deviceState, 
                int deviceFlags, IntPtr pvSystemState, int stateFlags);

    [DllImport("coredll")]
    private extern static int ReleasePowerRequirement(IntPtr handle);
```
```
and call it this way :
```
```
IntPtr handle = SetPowerRequirement("BLK1:", 0 /* D0, Full On */, 1, IntPtr.Zero, 0);
    // Do something that requires the device to stay on ...
    ReleasePowerRequirement(handle);
```
```
But this is generally not a good practice, leaving a device with the backlight on for extended periods might reduce dramatically its autonomy.