[Cf. Skills] preventing smartphone from entering sleep state

Source: Internet
Author: User
Tags sleep function
I mentioned how to program your Program It is also mentioned that the opennetcf is used to run programs at regular intervals for a long time. Article Here:
Http://www.cnblogs.com/fox23/archive/2008/02/03/AtTime.html
In fact, there is another interesting way to prevent the mobile phone from entering sleep state through simple registry settings on the smartphone.

First, the easiest way to think of is to constantly send empty (keyboard) messages to the OS: Keybd_event (vk_noname,0, Keyeventf_silent,0);

However, this will keep the backlight on, which is a waste. Therefore, we imagine that it would be nice to have related settings in the registry. After a simple review of the registry, there are some corresponding keys that can be set to prevent the WM device from sleep.
Open the Remote Registry Editor of vs2008 and connect to our smartphone. Here we use wm6.1 standard as an example to browse to the following directory:

In the hkcu/controlpanel/power directory, find the display key and change the DWORD Value (60 by default) to-1, which is equivalent to disabling the timed sleep function of the system.
Next, to make this change take effect immediately, we need to broadcast a message to let the OS know that a key value has changed during initialization: Postmessage (hwnd_broadcast, wm_wininichange,0,0);

Corresponding settings are also available on the Pocket PC:

Here, we recommend an article in the garden:
Http://www.cnblogs.com/Endink/archive/2006/07/18/sharping.html
This article introducesCodeControl backlights and periodic callsThe systemidletimerreset () function is used to reset the Sleep Timer.
Finally, we will remind you that you should not forget to restore all the changes to the registry in the program to the original settings when you exit the program, so as not to affect your use.

Enjoy it!

Yellow winter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.