Summary of simple scene modes set by WinCE ~

Source: Internet
Author: User

Recently, I want to create a scenario, but simply implement three states: normal volume, vibration, and mute.

Originally, it would not be very difficult to think about such a simple one. If no relevant function is found at the beginning, the Registry changes will be captured to implement these three states.

The results can be implemented in these three states. Haha, I learned several useful registry items.

Hkcu/controlpanel/notifications/shelloverrides: mode. 0 indicates normal, 1 indicates vibration, 2 indicates mute

Hkcu/controlpanel/volume:

_ T ("key") // press the volume

_ T ("ringer") // THIS IS NOT CLEAR
_ T ("screen") // It should be the screen volume.
_ T ("volume") // system volume

Hkcu/controlpanel/soundcategories/ring: initvol this is the second column of the Adjustment Volume (0-5)

 

The volume backup value in the system status is saved in

Hkcu/controlpanel/notifications/shelloverrides:

_ T ("savedkey ")
_ T ("saveringer ")
_ T ("savedscreen ")
_ T ("savedvolume ")

The text in copy snapi. H also needs to be set in the phone.

//////////////////////////////////////// ////////////////////////////////////////
// Phoneringeroff
// Gets a value indicating whether the phone's ringer is off (I. e., if it rings and/or vibrates ).
# Define sn_phoneringeroff_root HKEY_LOCAL_MACHINE
# Define sn_phoneringeroff_path text ("system // state // phone ")
# Define sn_phoneringeroff_value text ("status ")
# Define sn_phoneringeroff_bitmask 0x40
//////////////////////////////////////// //////////////////////////////////

 

You can set the corresponding mode and volume to implement the corresponding functions, but the horn icon on the titlebar has not changed...

This problem is very depressing. Later I found two articles on the Internet, so I don't have to maintain the registry myself,

You can change the icon in the title bar above ~

Http://social.msdn.microsoft.com/Forums/zh-TW/803/thread/cb9786c0-823b-4bb1-9f54-12815695ae9c

Http://www.devdiv.com/thread-24092-1-1.html

 

Is to use the sndsetsound () function.

// Set the top column horn icon to (by jlzg) Open <br/> sndfileinfo sndfile1; <br/> token = snd_soundtype_on; <br/> sndsetsound (snd_event_all, & sndfile1, true); </P> <p> // set the top column horn icon to (by jjlzg) Vibration <br/> sndfileinfo sndfile2; <br/> sndfile2.ssttype = snd_soundtype_vibrate; <br/> sndsetsound (snd_event_all, & sndfile2, true );

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.