MoDaCo is undergoing planned maintenance. Site functionality may be reduced - follow @modaco or @paulobrien on Twitter for updates.

  • Announcements

    • Reminder - MoDaCo position on illegal content

      ILLEGAL CONTENT I'd like to just reaffirm MoDaCo's position regarding piracy and illegal content in the light of some recent questions / postings. Posts will be censored by myself or my moderation team if the contain or link to: Illegal / pirated / cracked software or sites that host such software
      Nintendo emulators / ROMs or sites hosting them (in light of Nintendo's legal stance)


      CUSTOM ROMS

      You may discuss and post links to custom device ROMs on MoDaCo, provided the following rules are adhered to: ROMs must not be hosted directly in topic via the MoDaCo attachment system
      ROMs must not contain any illegal 3rd party software (this includes trial versions included without permission)
      ROMs must give full credit to the original author
      This decision has been taken in light of the huge amount of interest in this area of device customisation within the community, and member feedback! Please note that custom ROM discussion should be kept in specific device sub-areas, (e.g. Kaiser.MoDaCo.com for Kaiser based devices). ISSUES If you have any issues with this policy, please contact me directly via PM. P
    • Support MoDaCo by signing up to a MoDaCo Silver or Gold membership

      To sign up to an annual MoDaCo Silver subscription which will eliminate all ads from the site (as well as giving you access to the MoDaCo Online Kitchens for Android) for only £9.99 using PayPal, Credit or Debit Card, ensure you are logged in to the site, and then click the link below, which will take you directly to the subscription store! You can also sign up to an annual MoDaCo Gold subscription for £29.99, which adds the benefits listed below! PURCHASE A MODACO SUBSCRIPTION - FREE Titanium Backup Mobile for Android worth $5.99! - FREE 1 year PrivateInternetAccess.com worth $39.95! - FREE 1 year LastPass Premium worth $12! - FREE CalcConvert for Pocket PC from Binaryfish worth $17.95! - FREE Calendar Bar for Pocket PC from OmegaOne worth $9.99! - FREE CamerAware for Pocket PC and Smartphone from MoDaCo worth £19.99 / $30! - FREE Chronos for Pocket PC from ActiveKitten worth $14.95! - FREE CodeWallet Pro for Smartphone and Pocket PC from DeveloperOne worth up to $24.95! - FREE Concentrix for Pocket PC from eSoft Interactive worth $9.95! - FREE FlexMail for Pocket PC and Smartphone from WebIS worth up to $59.90! - FREE FTouchSL for Pocket PC from Vekoff s.r.o. worth 10 euro / $12.50! - FREE Jewel Challenge for Pocket PC from eSoft Interactive worth $9.95! - FREE John Cody's Alerts Pro for Smartphone from Omnisoft worth $14.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Dutch for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> French for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> German for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Italian for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Spanish for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Dutch for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> French for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> German for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Russian for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Turkish for Smartphone from Lingvosoft worth $49.95! - FREE Note2Self for Pocket PC and Smartphone from WebIS worth up to $19.90! - FREE Opera 8.60 for Pocket PC and Smartphone from Opera Software worth up to $48! - FREE Pocket Informant for Pocket PC and Smartphone from WebIS worth up to $59.90! - FREE Pocket Launcher for Pocket PC and Smartphone from Conduits worth $9.95! - FREE PTab for Pocket PC and Smartphone from z4soft worth up to $60! - FREE Resco Explorer for Pocket PC and Smartphone from Resco worth up to $49.90! - FREE Safemode for Pocket PC from monocube worth $12.95 - FREE SplashPhoto for Pocket PC and Smartphone from SplashData worth up to $59.90! - FREE Sprite Backup for Pocket PC and Smartphone from Sprite Software worth $29.95! - FREE Teksoft Glyphs UI for Pocket PC and Smartphone from Teksoft €9.95! - FREE Teksoft HeadsetRemote for Pocket PC and Smartphone from Teksoft €4.95! - FREE Traffic Jam for Pocket PC from eSoft Interactive worth $9.95! - FREE unlock (1 per year) from imei-check.co.uk - DISCOUNT of 10% at MoDaCo FairDeal - DISCOUNT of 10% at Semsons.com - FORUM - AD FREE SITE - FORUM - custom rank / title - FORUM - double competition entries - FORUM - double post attachment space - FORUM - no search flood control - FORUM - priority event registration - FORUM - triple PM space
    • Reminder: Selling items on the forum directly is not allowed

      Please note that selling items on the forum directly is not allowed by the forum rules. There is a forum for eBay auctions whereby you can list the items on eBay and link to them there. This is the ONLY forum for this type of activity. You may also advertise links to the eBay forum in your signature. Please note that selling directly in contravention of these rules will result in a warning / suspensions / ban.
Sign in to follow this  
Followers 0

Turning off Display and Backlight?

37 posts in this topic

Posted (edited) · Report post

I've managed to turn the backlight off / on - no problem, but I cannot turn the actual display itselft off.

Has anyone managed to do this? The example in Peter Foots blog does not work for the smartphone, only the iPAQ :D

   <DllImport("coredll")> _

Private Shared Function DevicePowerNotify( _

ByVal pvDevice As String, _

ByVal deviceState As PowerState, _

ByVal DeviceFlags As Integer)

    End Function


Private Enum PowerState

        PwrDeviceUnspecified = -1

        'full on

        D0 = 0

        'low power

        D1 = 1

        'standby

        D2 = 2

        'sleep

        D3 = 3

        'off

        D4 = 4

        PwrDeviceMaximum = 5

    End Enum


'---Force backlight off...

DevicePowerNotify("BKL1:", PowerState.D3, 1) '---D4 powers off the display AND the keypad which is no good

Any help appreciated! :D

Edited by gaplayer26
0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

I think u only can use registry changings.

I used this example to set backlight to half power in an application.

the problem is, that on keypresses gets full power.

so I set the registry setting for backlicht time to 0.

But this only works , after a reset.

How I can tell driver for backlight that value changed programmatically ?

I founf this in C:

void SetBacklight(int value)

{

HKEY hKey = NULL;

DWORD dwDisposition = 0;

if (RegCreateKeyEx(HKEY_CURRENT_USER, _T("ControlPanel\\Backlight"),0, NULL,

0, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition) == ERROR_SUCCESS)

{

// Set backlight value for AC and Battery power

if (RegSetValueEx(hKey, _T("ACBrightNess"), 0, REG_DWORD, (PBYTE) &value,

sizeof(REG_DWORD)) == ERROR_SUCCESS)

{

if (RegSetValueEx(hKey, _T("BrightNess"), 0, REG_DWORD, (PBYTE)&value,

sizeof(REG_DWORD)) == ERROR_SUCCESS)

{

// Signal display driver to update

HANDLE hBackLightEvent = CreateEvent( NULL, FALSE, TRUE,

TEXT("BackLightChangeEvent"));

if (hBackLightEvent)

{

SetEvent(hBackLightEvent);

CloseHandle(hBackLightEvent);

}

}

}

}

}

But I need to use the Backlightchangeevent in VB.Net.

Changing registry values in VB.net is done.(with OpenNetCF)

But never worked with events before .

Tried a C to VB converter, but doesnt work.

anyone so kind to give me the complete code to use the backlightchangevent in VB.net ?

Edited by dieter98
0

Share this post


Link to post
Share on other sites

Posted · Report post

anyone so kind to give me the complete code to use the backlightchangevent in VB.net ?

<{POST_SNAPBACK}>

The code in my first post should do just what you want - Power off the dislplay backlight (you can choose halfbright, off etc by setting D value).

DevicePowerNotify("BKL1:", PowerState.D3, 1)
This will power off the dislpay light and keep it off, even if the user presses a key... To restore normal functionality (backllight comes on during keypress):
DevicePowerNotify("BKL1:", PowerState.PowerDeviceUnspecified, 1)

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Ok, but I mean something other.

The code works fine, I can set backlicht to half power an my SP3.

Problem is , that keypresses overide it , on keypresses backlight goes to full power for the defined time in settings.

So i changed the setting for backlight in registry to 0 programmatically.

But this has only effect after a reset, cause driver backlight has not got the changes.

Therefore is the backlightchangeevent.

U see it at the end of the code i posted.

But is C# , i tried to translate it to VB.Net, but failed.

Never worked with events before.

So I requested the full code in VB.net to raise theat event.

After this , keypresses have no effect to the settings from ur code.

// Signal display driver to update

HANDLE hBackLightEvent = CreateEvent( NULL, FALSE, TRUE,

TEXT("BackLightChangeEvent"));

if (hBackLightEvent)

{

SetEvent(hBackLightEvent);

CloseHandle(hBackLightEvent);

}

Edited by dieter98
0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Problem is , that keypresses overide it , on keypresses backlight goes to full power for the defined time in settings.

hmm, strange. If I use:

DevicePowerNotify("BKL1:", PowerState.D3, 1)

The backlight stays off, even if the user presses a keypress... :cry:

I think we (at least I do!) need Uncle Pete's (Peter Foot) help :D

Edited by gaplayer26
0

Share this post


Link to post
Share on other sites

Posted · Report post

I used value 2 , so display goes to half brightness (Imate SP3),

but on keypresses to full power.

i also tried the exampele form OpenNETCF with

SetPowerRequirement("BKL1:", 2, 1, IntPtr.Zero, 0)

but is the same.

What SP do you use?

I think for my the only way is the Backlightchangeevent

to sent registry value to driver.

But failed in translate code from C to VBNet.

anyone can post the VB code to use this event ?

0

Share this post


Link to post
Share on other sites

Posted · Report post

What SP do you use?

<{POST_SNAPBACK}>

I'm using the SPV C500...

0

Share this post


Link to post
Share on other sites

Posted · Report post

Sorry to possibly hijack this thread, but would this type of code be useful for dimming the backlight when watching something on Pocket TV? I notice if I'm watching in the dark that the standard backlight setting is too bright for dark scenes, and no amount of adjusting the picture brightness or contrast helps this. If I could set the backlight to lower power it would be much improved.

I'm on an SPV Classic, which I notice already has two backlight settings, full power and then a dimmed setting which comes on about a second before the backlight auto powers off.

0

Share this post


Link to post
Share on other sites

Posted · Report post

Sorry to possibly hijack this thread, but would this type of code be useful for dimming the backlight when watching something on Pocket TV? I notice if I'm watching in the dark that the standard backlight setting is too bright for dark scenes, and no amount of adjusting the picture brightness or contrast helps this. If I could set the backlight to lower power it would be much improved.

I'm on an SPV Classic, which I notice already has two backlight settings, full power and then a dimmed setting which comes on about a second before the backlight auto powers off.

<{POST_SNAPBACK}>

Should do, worth a try...

0

Share this post


Link to post
Share on other sites

Posted · Report post

Dim hevent As IntPtr = OpenNETCF.Win32.Core.CreateEvent(False, False, "BackLightChangeEvent")

If (Not IsNothing(hevent)) Then

OpenNETCF.Win32.Core.SetEvent(hevent)

OpenNETCF.Win32.Core.ResetEvent(hevent)

End If

now I can set backlight on SP on half, keypresses dont override it, and ending my apps BacklightTimeout is reset to old behavior.

But if another app ( camera etc,) request full backlight it is full so lang app is in foreground.

0

Share this post


Link to post
Share on other sites

Posted · Report post

Dim hevent As IntPtr = OpenNETCF.Win32.Core.CreateEvent(False, False, "BackLightChangeEvent")

        If (Not IsNothing(hevent)) Then

            OpenNETCF.Win32.Core.SetEvent(hevent)

            OpenNETCF.Win32.Core.ResetEvent(hevent)

        End If

now I can set backlight on SP on half, keypresses dont override it, and ending my apps BacklightTimeout is reset to old behavior.

But if another app ( camera etc,) request full backlight it is full so lang app is in foreground.

<{POST_SNAPBACK}>

Is that the entire code?

0

Share this post


Link to post
Share on other sites

Posted · Report post

No , that is to fire the backlightchangeevent.

I do so:

read registry vallue current user\controlpanel\backlight\batterietimeout

write 0 in this place

use ur posted code to set backlight to half

my code above for backlight changeevent

to stop all :

write old backlightvalue back

backlightchangeevent

to normal settings from ur code

must use OpenNetCF

tried a lot of use event with normal VB.Net, but all failed, oenNet works

so my code looks a little confused at moment, for that many tries I made

0

Share this post


Link to post
Share on other sites

Posted · Report post

gaplayer26 if you succeed to do the trick with the SPV C500 can you write an How to do step by step ?

Thx in advance

sorry for my pidgin english.

0

Share this post


Link to post
Share on other sites

Posted · Report post

Try this, OpenNetCF must be installed.

( It based on Torchlite.exe)

Backlight.exe

0

Share this post


Link to post
Share on other sites

Posted · Report post

gaplayer26 if you succeed to do the trick with the SPV C500 can you write an How to do step by step ?

Thx in advance

sorry for my pidgin english.

<{POST_SNAPBACK}>

Thanks, but dieter98 appears to be the one with the solution! :D If I do succeed I will post the source :D

Try this, OpenNetCF must be installed.

( It based on Torchlite.exe)

<{POST_SNAPBACK}>

Can you post the source to this?

Thanks

:P

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Yes please, if you could post some source code, that'd be great - I'm getting very close to inflicting bodily harm to myself... :|

Edited by gaplayer26
0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

deleted

Edited by dieter98
0

Share this post


Link to post
Share on other sites

Posted · Report post

Here is the code I played around with.

Maybee it looks a little bit confused, but was only for testing and I took the relevant things from it in another app.

Try to improve it or not.

BackLite.zip

0

Share this post


Link to post
Share on other sites

Posted · Report post

OK, thanks for the code! :D

0

Share this post


Link to post
Share on other sites

Posted · Report post

Thx for your reply ! :D

well i can't get Backlight.exe to work with my SPV C500, you say that you have to install opencf.net, but how to ?

I have download SmartDeviceFramework12 here at http://www.opennetcf.org/CategoryView.aspx?category=Home

But i can get it to works with my windows sp2, it says Microsoft visual studio.net 2003 with the compact framework is required ...

Anyway thx dieter98 and gaplayer26 for the aswers !

0

Share this post


Link to post
Share on other sites

Posted · Report post

I tried to build a cab for this all, but got error:

Cabwiz.exe could not be invoked

Whats wrong ??

0

Share this post


Link to post
Share on other sites

Posted · Report post

I tried to build a cab for this all, but got error:

Cabwiz.exe  could not be invoked

Whats wrong ??

<{POST_SNAPBACK}>

You need to use CabwizSP for smartphone builds. It's part of the WM2003 SDK.

I use it like this from a batch file/command line:

"C:\Program Files\Windows CE Tools\wce420\SMARTPHONE 2003\Tools\cabwizsp.exe" "D:\Data\My Documents\Visual Studio Projects\****PROGRAM HERE***\obj\Debug\***PROGRAM INF HERE***.inf" /dest "D:\Data\My Documents\Visual Studio Projects\****PROGRAM HERE***\obj\Debug" /err CabWiz.SMP.log /cpu ARMV4

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Found this out also, but in batch file there isd a complete different path for cabwiz.

How to tell VSNet the right path, didnt found out it.

To lazy to type in batch.

Hey, but now a can copy and past from ur post!

But there is also the new pass to set in the inf file at several places.

But how to set the right path in VS , so that i must not do all that changes in the bat and inf file ?

Edited by dieter98
0

Share this post


Link to post
Share on other sites

Posted · Report post

Thx for your reply ! :D

well i can't get Backlight.exe to work with my SPV C500, you say that you have to install opencf.net, but how to ?

I have download SmartDeviceFramework12 here at http://www.opennetcf.org/CategoryView.aspx?category=Home

But i can get it to works with my windows sp2, it says Microsoft visual studio.net 2003 with the compact framework is required ...

Anyway thx dieter98 and gaplayer26 for the aswers !

<{POST_SNAPBACK}>

here is a simple verion without opnnet, plz try it.

BackLite.exe

0

Share this post


Link to post
Share on other sites

Posted · Report post

Hi All,

Can someone please make a .cab file for this. I would like to try it on my Audiovox SMT5600? Thanks!

8)

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2015. MoDaCo uses IntelliTxt technology.