Hi,

I would like to let always the screen on so I was trying using the
fonction : SystemIdleTimerReset but it's seems to not work on my
device.
I have tried to put SystemIdleTimerReset() everywhere into my code but
the screen is turning off either.
It's C# code.
This is how I import the DLL :

* My code sample :


[DllImport("coredll.dll")]
static extern void SystemIdleTimerReset();

Do you know if I'm doing something wrong or if I can find another way
to do it.
The other thing is that I don't want to touch to the registry keys.

Thank you for your help.

Re: let screen on during work by ctacke/>

ctacke/>
Sat May 20 07:48:14 CDT 2006

Putting the code "everywhere" isn't useful. You have to call it
periodically - the period must be less than the system timeout period.

-Chris

<nicolas.lelievre@gmail.com> wrote in message
news:1148073008.707811.194420@g10g2000cwb.googlegroups.com...
> Hi,
>
> I would like to let always the screen on so I was trying using the
> fonction : SystemIdleTimerReset but it's seems to not work on my
> device.
> I have tried to put SystemIdleTimerReset() everywhere into my code but
> the screen is turning off either.
> It's C# code.
> This is how I import the DLL :
>
> * My code sample :
>
>
> [DllImport("coredll.dll")]
> static extern void SystemIdleTimerReset();
>
> Do you know if I'm doing something wrong or if I can find another way
> to do it.
> The other thing is that I don't want to touch to the registry keys.
>
> Thank you for your help.
>



Re: let screen on during work by nicolas

nicolas
Mon May 22 11:32:00 CDT 2006

Yes of course it's not useful but what I mean it's even if I put it
everywhere it doesn's seems to work as expected....

--

Nicolas


Re: let screen on during work by ctacke/>

ctacke/>
Mon May 22 12:05:30 CDT 2006

Are you calling it periodically in a time interval less than the timeout?
If not it won't work. Period.

-Chris


<nicolas.lelievre@gmail.com> wrote in message
news:1148315520.379306.308460@y43g2000cwc.googlegroups.com...
> Yes of course it's not useful but what I mean it's even if I put it
> everywhere it doesn's seems to work as expected....
>
> --
>
> Nicolas
>



Re: let screen on during work by nicolas

nicolas
Mon May 22 12:18:22 CDT 2006

Yes, but I find my error, this is how I need to write it :

[DllImport("coredll.dll", EntryPoint = "SystemIdleTimerReset")]
public static extern void SystemIdleTimerReset();

now it works...

Thanks !


Re: let screen on during work by ctacke/>

ctacke/>
Mon May 22 12:38:51 CDT 2006

There's no difference between this and the original other than it's marked
public. The EntryPoint meta is useful when you want to alias. If it's the
same as your declared function it has no effect.

-Chris

<nicolas.lelievre@gmail.com> wrote in message
news:1148318302.525310.113670@i40g2000cwc.googlegroups.com...
> Yes, but I find my error, this is how I need to write it :
>
> [DllImport("coredll.dll", EntryPoint = "SystemIdleTimerReset")]
> public static extern void SystemIdleTimerReset();
>
> now it works...
>
> Thanks !
>



Re: let screen on during work by nicolas

nicolas
Tue May 30 12:31:03 CDT 2006

The only difference is that now it's working ;)