Disabling Auto-Power off - Windows Mobile Development and Hacking General

The application I'm developing needs the device to always remain on, even until the battery runs out, so I need to disable the auto power off feature if it has been enabled.
I've tried using
Code:
SystemParametersInfo(SPI_SETBATTERYIDLETIMEOUT,...);
but it just doesn't work. Returns success but nothing changes, not even the registry keys where the values are held. I found the registry settings in HKLM\System\CurrentControlSet\Control\Power\Timeouts, and played around with setting them, but they aren't picked up until a soft reset occurs which isn't a viable solution.
So the first thing I need to know is what the difference between the reg keys
HKLM\System\CCS\Control\Power\Timeouts\BattSuspendTimeout:dword
and
HKLM\System\CCS\Control\Power\BattPowerOff:dword
are.
They both seem to contain the same value, and similar names.
The second thing I need to know is what needs to be done to notify the system that the idle timeout has changed, and to reload the value from the registry. I tried an HWND_BROADCAST of WM_SETTINGCHANGED but to no avail. How does the system dialog where you can change the idle timeouts inform the system those values have changed??
Thanks,
Timbo.

Related

Registry edits get reverted after reset

Does anybody know why this happens:
Whenever I change registry (for example HKCU\Control Panel\SIP\..), after reboot it gets reverted to original value.
I used Total Commnader. Roms I tried: 2.17 (qtek) and 2.24 (cingular).
Help appreciated.
Thanks.
after changing your registry, be sure to save the changes by a soft reset. To do this, do NOT poke the reset hole with your stylus, but rather shut the device down with the on/off button. Hold it for 5 secs untill the warning pops up. By resetting this way, your device uses the 5 secs untill the screen pops-up to write the registry to the ROM. If you soft reset immediately with your stylus after chaning the registry, the device has not enough time to write the changes to the ROM. Therefore, after a quick soft reset with your stylus changes might not be saved and the registry remains unchanged.
Problems with Registry settings
I also have problems with Registry settings. For instance some values seems to change back after a turn off/on (power button). Does anyone have a good doc/link that explains which Registry settings that actually can be changed by CAB-files and stay changed ?
Just to mention - on an SP5 (sorry for this in Wizard/K-JAM) I had a CAB-file that changed the Contacts soft-button into starting a 3rd party application. This only changed when an incomming call/phone application was started..a little confused about that

Registry changes not sticking...

Hi guys, I've tried editing my registry with regards to the A2DP issue with several softwares. Unfortunately, after rebooting the Trin (reset @ bottom of device), all changes I make seem to have disappeared.
I've used both Total commander and PHM as registry editor on the device itself and MobileRegistryEditor as a remote registry editor.
With the onboard reg editors I can make keys and add values but after reboot the entries have gone.
With the remote reg editor I can browse the reg without problems but get an access denied message when I attempt to edit anything...
For some reason or other I was able to add a MinSupportedBitPool setting one time. Don't know what was different that time around though.
Deleting keys also works as they stay gone once deleted.
It's just adding the keys that is making me go mad!!!
See this thread
http://forum.xda-developers.com/showthread.php?t=310898
Thx ww2250, I didn't know this...
I had discovered meanwhile that if I used the reset option in the Trinityhacks app, I could make the changes stick, so this soft reset would be similar to holding down the power button apparantly.
Thx again
Yes indeed if you are doing a software reset, it will stick - the OS will flush the registry before restarting.

Police WinMo6 registry? (ie. prevent changes from being made)

On my PC, Spybot notifies me when applications are attempting to change registry keys and gives me the option to allow or deny, and to make my decision sticky. Is there an app for WinMo that will provide the same type of functionality?
I'm thinking that if I could block out the reg change that's made when my 6800 keyboard is slid open, I can prevent the screen from auto-rotating
Feasible?
I haven't heard of a wm program that does this...seems like it would have to be persistent in memory to catch the changes.
Just curious, are you sure the auto-rotate uses the registry at all?
Yup, it sure does. I specifically kept the GDI/ROTATION key open in Resco Reg Explorer when I slid the keyboard out and in, sure enough the value changes and changes back when they keyboard is moved. So SOMETHING is telling that value to change.. just have to figure out what, or somehow lock that reg key LOL

Power Settings are chnging

Hi
I did notice that sometimes, the POWER settings on my HD change by thenselves.
The backlight time values for 'on battery' and 'on external power' are increased drmaticaly. The The Backlight level values are decreased to their minimum values (although I use the 'auto adjust backlight').
I suspect that one of the programs I'm using causes all that.
I had installed amongst others the following programs:
S2U2
WkTASK
Please advice
I got similiar problem, these options are checked, but somehow, it will become unchecked.
I don't have S2U2 installed, I guess it is by other means......
Anyone can advice on this?
Some Navigation Applications alter these settings, cuz you need the device to be always ON while using navigation!
But I guess the real cause is that from the Navigation application itsself and/or Exiting the application in a wrong way i.e.: Terminate it, not using the EXIT Menu.
Give it a try, and let us know
Willy

[TUT]Baby steps with ceregeditor - comparing for registry changes

A brief 'how to' about finding which registry keys control simple settings.
(There are other methods and software, but the principal of save file, make changes, compare to file is common throughout)
HKCR - Hot Key Classes Root - not really sure, never really looked though, i always ignore it.
HKCU - Hot Key Current User - Holds short term info and user settings for the most part. Expect lots of changes found when you search this branch.
HKLM - Hot Key Local machine - Generally hard system settings, pretty static.
Get 'ceregeditor' and install it,
connect the phone to usb and allow it to connect to activesync,
in ceregeditor click connection - connect, jump to tools - unlock registry
(skip this step unless you get an error pops up later saying you cant make changes)
Now, down the left you see your registry main keys in a standard tree layout, HKCR, HKCU, HKLM
and on the right, the keys and values within the selected branch when you select on the left.
So, you want to find out which registry key controls, for example, phone keypad tones, long, short, off.
Select HKCU on the left, right click and choose export - and save it as something, HKCU would be the obvious choice, it doesn't matter.
Do the same for HKLM.
It will save all the sub keys of wehatever you select on the left.
you can select to start from sub keys by selecting the appropriate key in the left column, assuming you know which part of the registry you want to search.
most hardware settings are held in HKLM, with things like user preffs found in HKCU, but be warned HKCU changes frequently, so expect a long list of changes when you run a registry compare.)
Once you have saved the files (in all honesty, i dont create them both, usually i check HKLM first, and if i dont find what im looking for only then do i check HKCU)
make your change on your phone
(set phonepad keytones to off, for instance) then back in ceregeditor, right click the selected registry key and choose reload selected.
This makes sure ceregeditor is now aware of the new registry value from the phone.
Now go to compare - compare registry.
It will ask you for a file, point it to the one you just saved, and let it run, , ,it will tell you what keys have changed.
You may occasionally get unconnected changes thrown up, but use a little common sense and you can usually tell what is usefull and what isnt.
In the results window, down the left are the items that have changed, with details of the change on the right.
In our example with the keytones, (not a great example since the target is in the HKCU and so is lost among lots of other changes) you should be able to figure out that the keytone settings are held in
HKEY_CURRENT_USER\ControlPanel\Sounds\Keypress beepmode
Its usually fairly obvious which is the key you are after amid the noise of random system state changes.
When you find your target, put a tick in the box and hit export. You can now save that key (or keys if there are several changes you want to save)
Save it as .cereg and you will be able to simply run that file on your phone to apply those settings.
Or, with wincecabmanager (my other recommended piece of software alongside ceregeditor) its easy to import the reg file into a cab. You can keep adding to that cab as you find and extract more personalised settings.
Keep it in your autoinstall folder on your sd card, and it will always be applied when you hard reset.
My own 'my tweaks.cab' file is fat with various settings, tweaks, etc and i still add to it regularly.
It's true that it's often easier to trawl <searchengine></searchengine> and find the answer, and maybe even a cab to turn it on and off, but its a nice way to start p0king at your registry and seeing how things work, plus you can make one cab for yourself, adding tweaks one by one, without remembering to store loads of different ones and re apply them when you restore/hard reset.
you know, i've never thought of exporting the whole hkcu or hklm directory before. i'm going to have to try that. it'll be interesting to read through a lot of that.
I too have a registry tweak CAB for both my Wizard & Rhodium. Haven't made one for the HD2 yet, since most of the tweaks I've made were through one of the many different tweaking apps.
also, what's this about an autoinstall folder?
*edit* disregard the last part. I always use official roms so the autoinstall doesn't apply

Categories

Resources