[Windows Mobile Apps and Games] SlappyHours:
The good news:

+ It works now :) The screen is finally set to maximum brightness.

The bad news:

- Flashlight does not restore any original settings when quitting the application :( . So I have to adjust all settings manually.

*

* Let's have a look at the code

*

Layer 8: Frame 1 *************************************************
fscommand("ReadRegistryValue", "\"HKEY_LOCAL_MACHINE\", \"System\\\\CurrentControlSet\\\\Control\\\\Power\\\\Timeouts\", \"BattSuspendTimeout\", _root.VARIAVEL_BattSuspendTimeout" );
fscommand("ReadRegistryValue", "\"HKEY_LOCAL_MACHINE\", \"System\\\\CurrentControlSet\\\\Control\\\\Power\\\\Timeouts\", \"ACSuspendTimeout\", _root.VARIAVEL_ACSuspendTimeout" );
fscommand("ReadRegistryValue", "\"HKEY_CURRENT_USER\", \"ControlPanel\\\\Backlight\", \"BatteryTimeout\", _root.VARIAVEL_BatteryTimeout" );
fscommand("ReadRegistryValue", "\"HKEY_CURRENT_USER\", \"ControlPanel\\\\Backlight\", \"ACTimeout\", _root.VARIAVEL_ACTimeout" );
fscommand("ReadRegistryValue", "\"HKEY_CURRENT_USER\", \"ControlPanel\\\\Backlight\", \"Brightness\", _root.VARIAVEL_Brightness" );
fscommand("ReadRegistryValue", "\"HKEY_CURRENT_USER\", \"ControlPanel\\\\Backlight\", \"ACBrightness\", _root.VARIAVEL_ACBrightness" );
fscommand("ReadRegistryValue", "\"HKEY_CURRENT_USER\", \"ControlPanel\\\\Backlight\", \"BatteryBrightness\", _root.VARIAVEL_BatteryBrightness" );

fscommand("ReadRegistryValue", "\"HKEY_LOCAL_MACHINE\", \"Software\\\\FlashLIGHT\", \"MAX\", _root.maxy" );
fscommand("ReadRegistryValue", "\"HKEY_LOCAL_MACHINE\", \"Software\\\\FlashLIGHT\", \"WORD\", _root.WordV" );
fscommand("ReadRegistryValue", "\"HKEY_LOCAL_MACHINE\", \"Software\\\\FlashLIGHT\", \"REGNAME\", _root.regname" );

Layer 8: Frame 6 ***************************************************
fscommand("WriteRegistryValue", "\"HKEY_LOCAL_MACHINE\", \"System\\\\CurrentControlSet\\\\Control\\\\Power\\\\Timeouts\", \"BattSuspendTimeout\", \"DWORD\", 0");
fscommand("WriteRegistryValue", "\"HKEY_LOCAL_MACHINE\", \"System\\\\CurrentControlSet\\\\Control\\\\Power\\\\Timeouts\", \"ACSuspendTimeout\", \"DWORD\", 0");
fscommand("WriteRegistryValue", "\"HKEY_CURRENT_USER\", \"ControlPanel\\\\BackLight\", \"BatteryTimeout\", \"DWORD\", 0");
fscommand("WriteRegistryValue", "\"HKEY_CURRENT_USER\", \"ControlPanel\\\\BackLight\", \"ACTimeout\", \"DWORD\", 0");
fscommand("WriteRegistryValue", "\"HKEY_CURRENT_USER\", \"ControlPanel\\\\BackLight\", \"ACBrightness\", \"DWORD\", 10");

if (_root.maxy == undefined) {
fscommand("WriteRegistryValue", "\"HKEY_CURRENT_USER\", \"ControlPanel\\\\BackLight\", \"Brightness\", \"DWORD\", 10");
} else {
fscommand("WriteRegistryValue", "\"HKEY_CURRENT_USER\", \"ControlPanel\\\\BackLight\", \""+_root.regname+"\", \""+_root.WordV+"\", "+_root.maxy+"");
}

Layer 1: Frame 26 ****************************************************
fscommand("WriteRegistryValue", "\"HKEY_LOCAL_MACHINE\", \"System\\\\CurrentControlSet\\\\Control\\\\Power\\\\Timeouts\", \"BattSuspendTimeout\", \"DWORD\", "+_root.VARIAVEL_BattSuspendTimeout );
fscommand("WriteRegistryValue", "\"HKEY_LOCAL_MACHINE\", \"System\\\\CurrentControlSet\\\\Control\\\\Power\\\\Timeouts\", \"ACSuspendTimeout\", \"DWORD\", "+_root.VARIAVEL_ACSuspendTimeout );
fscommand("WriteRegistryValue", "\"HKEY_CURRENT_USER\", \"ControlPanel\\\\BackLight\", \"BatteryTimeout\", \"DWORD\", "+_root.VARIAVEL_BatteryTimeout );
fscommand("WriteRegistryValue", "\"HKEY_CURRENT_USER\", \"ControlPanel\\\\BackLight\", \"ACTimeout\", \"DWORD\", "+_root.VARIAVEL_ACTimeout );
fscommand("WriteRegistryValue", "\"HKEY_CURRENT_USER\", \"ControlPanel\\\\BackLight\", \"ACBrightness\", \"DWORD\", "+_root.VARIAVEL_ACBrightness );
fscommand("WriteRegistryValue", "\"HKEY_CURRENT_USER\", \"ControlPanel\\\\BackLight\", \"Brightness\", \"DWORD\", "+_root.VARIAVEL_Brightness );

fscommand("quit", true);
play();

1. In Layer 8: Frame 1 FLASHLIGHT does not read the custom value. If there is a custom value, FLASHLIGHT needs to store the custom value to write it back later on.

2. In Layer 1: Frame 26 FLASHLIGHT restores all values - but it does not restore the custom value!

So there is definitly code missing. But unfortunately all other settings like "BattSuspendTimeout" do not get restored correctly either :(. So either FLASHLIGHT did not read the values correctly at the beginning and therefore variables like root.VARIAVEL_BattSuspendTimeout do not contain valid values. Or FLASHLIGHT does not write the registry correctly when quitting the app.

Hope this helps :)