[Sable] Solaris_irc:
the problem seems to be that the backlight app is send to the background by the players and voice recorders, it would be cool if the togglescreenmonitor.exe could just monitor the request and after that just send the apropiate power state+ipaqutils.dll screen off request or the other way around ipaqutils.dll request+apropiate power state to turn off the screen and lock keys, and with that the unlock would be with the power key to leave that power state.

not shure if it helps but here is a reference from CodeProject:

System Power States

Windows Mobile devices have several predefined power states. Some of these states are specific to the Pocket PC, some to the Smartphone, and others can be found on both. The following table lists the power states, and describes what occurs to transition the device into a said power state. P means that a state is applicable to Pocket PCs, and S means the state is applicable to Smartphones.

On

SP

Full powered on state.

BacklightOff

SP

The user has not interacted with the system for some time. and the backlight has turned off. The timeout for this to occur is set through the backlight setting in the Control Panel.

UserIdle

S

This state is currently specific to Smartphone devices, but will be implemented on Pocket PCs once they switch to the always on power mode. In this state, the backlight and the screen are turned off.

ScreenOff

SP

In this state, the user has specifically turned the screen off. This is different from the screen being ruined off due to idleness.

Unattended

P

This mode is specific to Pocket PCs. The screen, backlight, and the audio are all turned off, but the programs on the device are running. This enables ActiveSync to check e-mail without alerting the user. From the user's perspective, the device is sleeping.

Resuming

P

When a device wakes up from sleeping, it is in this mode. The backlight and the screen are still off, and programs have a 15 second window to switch the device to another power state before the device automatically goes back to the suspended state.

Suspended

P

The device is sleeping and the processor is halted. The device will not come out of this state until a hardware event wakes it up.

Off

SP

The device is not performing any actions and is not consuming power (exception: though, in some devices, the system clock may still draw power to maintain time).

Note that programs can alter a device's transition among power states. An example of such a program is an instant messenger which may prevent a device from suspending so that it can continue to receive messages.

Device Driver Power States

The individual components of Windows Mobile Devices can have their own power states, the most noticeable of which is the screen and the backlight. The device can be on while the backlight or the screen is turned off (a common power configuration when using a media player). The power states for device drivers are named a little more abstractly.

State	Description

D0	Device is fully powered

D1	Device is functional but in power savings mode

D2	Device is in standby

D3	Device is in sleep mode

D4	Device is Unpowered

Depending on the hardware and driver, some of these power states are identical. When the power state of a device needs to be changed, a request to change the state should be passed through DevicePowerNotify. Requesting a power state change doesn't guarantee that the state will be changed. The driver is still able to make its own decision on whether or not the power state will change (remember, your program is not the only program running, and isn't the only program that influences power state).

Requesting and Changing the Power State

Use the native function GetDevicePower if you need to monitor or query the power state. Instead of polling the state though GetDevicePower, your program can request notifications for power change events through RequestPowerNotifications.

If your application needs for the Windows Mobile device to stay in a certain power state, then use SetPowerRequirement to request the power state that your application needs. The OS will ensure that the power state of the device does not drop below what was requested. When the power state is no longer needed, then call ReleasePowerRequirement. To set the power state of a device driver instead of expressing minimum requirements, use SetDevicePower.

The power state of the system can be set through the native function SetSystemPowerState. The power state for individual hardware items in a Windows Mobile device can be set using SetDevicePower.

(You can also request that your program be started automatically during certain power change events. See Automatically Starting Your Application on Windows Mobile for more details.)

When you have an application that needs to run in unattended mode, use the native function PowerPolicyNotify() to inform the OS that you need for the device to continue to run without suspending. This is a reference-count API. For each call to this function with TRUE, you must also call this function with FALSE to ensure the device does not unnecessarily stay in a higher power.

Registered Device Power Settings for Power States

There are default device power settings for certain power states. For example, in unattended state, my Windows Mobile Professional phone turns off the backlight on the screen but keeps the sound adapter and the GPS receiver powered on. The information on these settings can be found in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\Timeouts\State\. For each one of the power states, you will find a key. The contents of this key are string sub keys whose names match hardware on the device and whose value match a device power state (so 0x04 matches D4, which means a certain piece of hardware will be on at full power in the matching state).

just some of the info, here is the rest of it: http://www.codeproject.com/KB/mobile/WiMoPower1.aspx

and here some info from msdn: http://msdn.microsoft.com/en-us/library/aa909892.aspx

and thanks again for the grat app!!!!!