Setting the brightness of the background light?

B

Boris Nienke

Hi,

is it possible to change the background-light-settings with C#?
I would like to dimm the light when the user clicks on a button and pump
it up when he hits another button...

but i cannot find a method for this? I thought it would be in
Environment oder System... but havn't found anything...

Any ideas?

Boris
 
P

Peter Foot [MVP]

The backlight control is hardware specific so what may work for one device
type may work differently on another. Providing a mechanism which would work
across any device type would be nigh on impossible.

Peter

--
Peter Foot
Windows Embedded MVP

In The Hand
http://www.inthehand.com
Handheld Interactive Reference Guides
 
B

Boris Nienke

OK, but what if i know which device i like to support?

To be specific: i would like to Support the iPaq3970 and the iPaq2210 -
maybe the iPaq5550

arn't there any controls to do that? Or a description how to do that
with this devices? Do i have to load a special DLL or so (then my next
question would be how to load such unmanaged DLL with C# ;) )

Boris
 
C

Chris Tacke, eMVP

As Peter said, it's device specific, so any APIs would come from the OEM.
You might chec to see if Compaq/HP's SDK has anything in it for backlight
control, otherwise contact their support or developer channel.

-Chris
 
B

Boris Nienke

OK, i will try that.

i just thought, i should have asked before i try to do this just to find
out that someone has ready-made-tools for this ;)

thank you

Boris
 
A

Alex Feinman [MVP]

On iPaq the library function SetBacklight does the following:
1) Sets the new value to HKCU\Control\Backlight\Brigthness (DWORD)
2) Opens event "BacklightChangeEvent" and calls ModifyEvent on it.

All of this should be possible to do using OpenNETCF library
(http://www.opennetcf.org)

HTH

Alex
 
B

Boris Nienke

Aha!
I have a similar registry-entry on the 2210 too!

Just on more question:
What do you mean with "open then event ... and call modify on it"? I'm
comming from the PC-World where i've worked with "PostMessage" ... i
have searched the MSDN but havn't found a code for
"BacklightChangeEvent"?

I think with OpenNETCF-Library you mean the WinAPI-Library?

I would be very happy for some more hints :blush:)

thank you

Boris
 
T

Thomas

Boris,

If you're still reading the group -- how did this go? Do you have any
sample code you can share? I was thinking of trying to implement this
in my application as well, for a ipaq 2215.

I noticed that an app such as Battery Pack has a small slider that it
places on the today screen that adjusts brightness. Not that I doubt
screen brightness is somewhat vendor specific, but there must be some
commonalities -- otherwise, people who develop apps like this would go
insane to support all devices.

Tom
 
B

Boris Nienke

Yes, it worked.
It works for the iPaq-Series and some other devices. Some have some special
registry setting for switching the light off/on - some do this
automatically... on some other devices it won't work at all (Dell for
example) because they don't have these registry-settings but implemented an
other solution to do this (i don't know which)

I have created a little application while i've tested around with
reading/writing registry and some other things (i don't like to write
useless code just to test some coding-things... ;-) ) - it's in german so
maybe you cannot understand the documentation:

http://www.nsonic.de/software

look for "Pocket Light Profiles"

Demo code should not be neccessary - just go to www.opennetcf.org, download
the registry and windows interfaces for CF and look for the CreateEvent and
SetEvent. You should be able to find information about the
"BacklightChangeEvent" in the MSDN-Documentation (with sample code which i
have simple adapted)

contact me via mail if still are stuck with this

Boris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top