RuaHaszardMorris
Tue Jul 13 22:49:03 CDT 2004
"Rua Haszard Morris" meant to write:
I'm trying to change the backlight brightnes from my C# app by changing appropriate registry values and then broadcasting the WM_WININICHANGED/WM_SETTINGSCHANGED message.
The following code (below) works great for updating the rgistry values, but the message isn't causing the changes to take effect.
When I launch the control panel applet, interestingly the changes take effect immediately. For example, I set brightness to 0 from my app, nothing happens, then I bring up the control panel applet and the backlight turns off & the sliders are on zero.
How should I be correctly forcing the changes to take effect?
[code]
private void DimBacklight(int brightness)
{
// from winuser.h
const int WM_WININICHANGE = 0x001A;
const int HWND_BROADCAST = 0xffff;
string regKey = /*\HKCU\*/ @"ControlPanel\Backlight";
string valueName = "BacklightLuminanceLevel";
RegistryKey key = Registry.CurrentUser.OpenSubKey(regKey, true);
key.SetValue(valueName, (object)brightness);
valueName = "ACBacklightLuminanceLevel";
RegistryKey key = Registry.CurrentUser.OpenSubKey(regKey, true);
key.SetValue(valueName, (object)brightness);
Win32Window.SendMessage(new System.IntPtr(HWND_BROADCAST), WM_WININICHANGE, 0xF2, 0);
}
[/code]
Thanks in advance for any help,
Rua HM
>
>
> "Chris Tacke, eMVP" wrote:
>
> > That's the right message for the backlight as well.
> >
> > -Chris
> >
> >
> > "KS" <ks@blah.com> wrote in message
> > news:uZDt7yCSEHA.3660@tk2msftngp13.phx.gbl...
> > > 99.99% of the time changing registry keys won't change the values for
> > > PocketPC unless you send a system message that the value has changed.
> > That
> > > is at least how changing the Today screen works, so I'm assuming the same
> > > would apply to the backlight settings. What system message gets sent when
> > > you change the backlight settings is something you'd have to run using a
> > > message spy app ...
> > >
> > >
http://www.pocketpcdn.com/articles/print_changetodaytheme.html
> > >
> > > This is the message you need to send that the registry values have changed
> > > for the Today screen ... hopefully it would work for the backlight too
> > .....
> > > but YMMV ...
> > >
> > > ::SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
> > >
> > > KS
> > >
> > > "Almon B. Strowger" <strowger@NOSPAM.kook.com> wrote in message
> > > news:OgyOcrCSEHA.2936@TK2MSFTNGP12.phx.gbl...
> > > > Hi,
> > > >
> > > > Surely the settings are in the registry, so you
> > > > could "temporarily" change them. If you don't know
> > > > where in the registry the settings are, make a copy
> > > > of the registry, then change the backlight settings
> > > > with the options screen and then make another copy
> > > > of the registry and compare the two--You'll quickly
> > > > find the setting key.
> > > >
> > > > Hope this helps...
> > > >
> > > > Almon B. Strowger
> > > > KOOK Pocket Software
> > > >
> > > >
> > > > "Robert A. Plourde Jr." <noone@hotmail.com> wrote in message
> > > > news:Ts6vc.8138$W01.6374@okepread01...
> > > > > I don't see any settings for the backlight in the DLL. It sounds
> > like,
> > > > the
> > > > > backlight settings are kicking in.
> > > > >
> > > > > If you go to Start / Settings / System then Backlight, you will see
> > that
> > > > > there are settings for turning off the backlight and turning on the
> > > > > backlight.
> > > > > From there you can go to the Brightness tab which shows settings for
> > on
> > > > > battery power, on ac power, and an automatic setting.
> > > > >
> > > > > There are two settings for brightness in the SDK. One for battery and
> > > one
> > > > > for ac.
> > > > >
> > > > > BOOL iPAQSetOnBatteryBrightnessLevel(DWORD * lpdwValue);
> > > > > BOOL iPAQSetOnPowerBrightnessLevel(DWORD * lpdwValue);
> > > > >
> > > > > It doesn't sound like they have any way to turn off the backlight
> > > settings
> > > > > programatically.
> > > > >
> > > > >
> > > > >
> > > > > "Andrew" <andrew@emmons.com> wrote in message
> > > > > news:80e69d55.0405281606.5e3438bc@posting.google.com...
> > > > > > I am using the brightness functions within iPAQUtil.dll to adjust
> > the
> > > > > > brightness of the display of a model 5500 iPAQ. An issue I am having
> > > > > > is that when setting the level to 0, the display dims to the minimum
> > > > > > level very quickly and then reverts back. This is very consistent
> > when
> > > > > > the device is on AC power. Once in a while on battery power the
> > > > > > brightness will stay at level 0, but any press on the screen reverts
> > > > > > it back.
> > > > > > I am trying to produce the same behaviour as the control panel
> > > > > > brightness selection - once it's set as 0, it stays that way until
> > > > > > changed - IE: screen taps, key presses, etc should have no effect.
> > > > > > Note that I have 'auto brightness' set to off in the control panel.
> > > > > >
> > > > > > Is there something I am missing, or an additional API call needed to
> > > > > > 'lock' the setting?
> > > > > >
> > > > > > Thank you!
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
> >