Hi all
A HUGE thanks to my contact at O for his help with this
This is one that people should find useful (I know I will).
(note : only appears to work on the SPV, E100 & E200 Smartphones - not the others)
As most of you will know, whilst an app is running if you don't press a key for a while the backlight timer kicks in and the screen dims, eventually dimming to off - or alternately the Home Page timeout kicks in and the phone returns to the home page.
If you want to keep the backlight completely on in an app AND stop the timeout to the homescreen altogether (very useful for games),
first include these 2 headers:-
then create a global variable :-
and then in your main app/game loop add this code :-
Basically every 9 seconds the code is run to stop the timers kicking in - why 9 seconds? I hear you cry. Well the lowest standard setting on backlight or home page timers is 10 seconds, so resetting them every 9 will do
happy coding,
muff
A HUGE thanks to my contact at O for his help with this
This is one that people should find useful (I know I will).
(note : only appears to work on the SPV, E100 & E200 Smartphones - not the others)
As most of you will know, whilst an app is running if you don't press a key for a while the backlight timer kicks in and the screen dims, eventually dimming to off - or alternately the Home Page timeout kicks in and the phone returns to the home page.
If you want to keep the backlight completely on in an app AND stop the timeout to the homescreen altogether (very useful for games),
first include these 2 headers:-
#include "windows.h" #include "tpcshell.h"
then create a global variable :-
DWORD lastTimerReset;
and then in your main app/game loop add this code :-
// every 9 seconds
if(GetTickCount() - lastTimerReset> 9000)
{
// this keeps the backlight on, but only on spv, e100, e200
#define EVENT_DISPLAYOFF TEXT("TIMEOUTDISPLAYOFF")
HANDLE g_hDispEvent = CreateEvent(NULL, FALSE, FALSE, EVENT_DISPLAYOFF);
SetEvent(g_hDispEvent); //LCD frontlight on
::SHIdleTimerReset();
lastTimerReset = GetTickCount();
}
Basically every 9 seconds the code is run to stop the timers kicking in - why 9 seconds? I hear you cry. Well the lowest standard setting on backlight or home page timers is 10 seconds, so resetting them every 9 will do
happy coding,
muff







Sign In
Create Account


Back to top











