Jump to content

Recommended Posts

Guest spv_dman
Posted

I've developed a simple mortscript that can enable, disable, or toggle the suspend mode of the device through registry alteration. Basically useful if you want to keep the device "awake" required by certain application. It works like "Dontsleep" program. But this script doesn't stay "memory-resident" unlike its counterparts, once executed it runs briefly then exits gracefully.

If anyone is interested and will find it useful, I can post it here

Guest frost_icewind
Posted
I've developed a simple mortscript that can enable, disable, or toggle the suspend mode of the device through registry alteration. Basically useful if you want to keep the device "awake" required by certain application. It works like "Dontsleep" program. But this script doesn't stay "memory-resident" unlike its counterparts, once executed it runs briefly then exits gracefully.

If anyone is interested and will find it useful, I can post it here

Hello! that sounds like a great script... would you mind posting it here? thank you!

Guest spv_dman
Posted (edited)

Ok. First off, I've tested this on Omnia 1, winmo 6.1, mortscript 4.2. This script modifies the registry and alters the power management settings along with the risk of messing up your phone so I leave it to your discretion if want to use my script. Suggest you make a backup using sprite, spb or related software beforehand. Also, you may backup the registry entry using resco explorer (registry addin).

I've created this script so the device doesn't go off while I'm reading my email and other applications dependent on the unit staying alive for it to continue. Also, I wanted my wifi to stay active without freezing my phone. I'm not sure if it's just me but my device goes into the infamous "black screen of death" if I untick "Enable Wi-fi power saving mode".

There are few applications out there (freeware and paid) like DontSleep and Smartlight Automatic Backlight which does the job but these programs stay memory resident and eats up memory. Also, I've had problems using DontSleep wherein I've had to softreset my phone a couple of times. There were some mortscripts which serves the same purpose by sending keystrokes periodically then again this consumes phone resources as well more than it should.

Anyway, regarding my script, some codes you'll find interesting on why it was applied. Well from what I've read since winmo 6, there were changes made on how the registry behaves. I haven't had much success in the past modifying just the timeout value until I discovered there are workarounds which I'll explain later. So here goes:

1. Disable suspend mode.

The timeout value "0" tells the device that it doesn't want to sleep. You can play around with it separately on how it behaves while in AC and Batt mode.

   RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts", "ACSuspendTimeout", 0)

   RegWriteDWord ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts", "BattSuspendTimeout", 0)
Here's the tricky part. We have to "initiate" backlight / suspend mode override. Altering the registry using the previous entries doesn't effect the changes right away unless you soft reset or open/close power management UI. This is sort of a work around since the backlight settings can be modified within the registry "on the fly" and related changes in the power settings are likewise saved. In this case we were able to instantiate the changes for the timeout values.
   RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeout", 0)

   RegWriteDWord ("HKCU", "ControlPanel\Backlight", "BatteryTimeout", 0)
Reverts original user backlight setting (my default setting's AC = 60 seconds; Batt = 30 seconds; user should set it back here)
   RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeout", 60)

   RegWriteDWord ("HKCU", "ControlPanel\Backlight", "BatteryTimeout", 30)
2. Enable suspend mode. This re-enables the suspend mode timeout (mine is set at 60 seconds; user should set it back here)
   RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts", "ACSuspendTimeout", 60)

   RegWriteDWord ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts", "BattSuspendTimeout", 60)
"Initiates" power management override using backlight setting
  RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeout", 0)

   RegWriteDWord ("HKCU", "ControlPanel\Backlight", "BatteryTimeout", 0)
Reverts original user backlight setting (my default setting's AC = 60 seconds; Batt = 30 seconds; user should set it back here)
   RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeout", 60)

   RegWriteDWord ("HKCU", "ControlPanel\Backlight", "BatteryTimeout", 30)

Attached script lets you toggle these settings. You may do a bit of revision so the backlight stays alive longer.

Again, use this at your own risk. Let me know if this script is helpful for your purpose :(

SuspendModeToggle.zip

Edited by spv_dman

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.