In wince, save the screen Brightness value in the Registry HKEY_CURRENT_USER \ ControlPanel \ Backlight \ Brightness. The value ranges from 0 to 100, so you need to change the screen Brightness, the Code is as follows:
/// <Summary> // adjust the screen brightness /// </summary> public class SetBackLight {public static void SetBright (string strValue) {SetBackLightValue (strValue ); reloadBackLight ();} public static int GetBacklightValue () {RegistryKey CUser = Registry. currentUser; RegistryKey Backlight = CUser. openSubKey ("ControlPanel \ Backlight", true); return (int) Backlight. getValue ("Brightness", RegistryValueKind. DWord);} public static void SetBackLightValue (string strValue) {try {RegistryKey hkcu = Registry. currentUser; RegistryKey Backlight = hkcu. openSubKey ("ControlPanel \ Backlight", true); Backlight. setValue ("Brightness", strValue, RegistryValueKind. DWord);} catch (Exception ex) {System. diagnostics. debug. writeLine (ex. message) ;}} public static bool ReloadBackLight () {bool ret = false; IntPtr scanEvent = NativeWin. createEvent (IntPtr. zero, false, false, "BackLightChangeEvent"); if (scanEvent = null) {throw new Exception ("CreateEvent failed");} else {NativeWin. eventModify (scanEvent, EventFlags. SET); NativeWin. closeHandle (scanEvent); ret = true;} return ret;} partial class NativeWin {[DllImport ("coredll. dll ", SetLastError = true, CharSet = CharSet. auto)] internal static extern IntPtr CreateEvent (IntPtr lpEventAttributes, [In, financialas (UnmanagedType. bool)] bool bManualReset, [In, financialas (UnmanagedType. bool)] bool bIntialState, [In, financialas (UnmanagedType. BStr)] string lpName); [DllImport ("coredll. dll ", SetLastError = true, CharSet = CharSet. auto)] [return: financialas (UnmanagedType. bool)] internal static extern bool CloseHandle (IntPtr hObject); [DllImport ("coredll. dll ", SetLastError = true)] [return: financialas (UnmanagedType. bool)] internal static extern bool EventModify (IntPtr hEvent, [In, financialas (UnmanagedType. u4)] EventFlags dEvent);} enum EventFlags: int {PULSE = 1, RESET = 2, SET = 3 }}