ah, OK i see - so using the idle-timout is just a "cleaner" solution to
reduce the timer-event-calls.
But it will work when i simply set the timer to 30 seconds or something?
I will try when i'm back home - thanks!
Boris
On Thu, 9 Jun 2005 14:04:33 -0700, Paul G. Tobey [eMVP] wrote:
> You could set the sleep time in the thread to the idle timeout, if you
> wanted to use as few cycles as reasonable for the thread itself...
>
> Paul T.
>
> "Chris Tacke, eMVP" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>>I wouldn't query anything. When you're doing a long operation, spawn a
>>worker thread that kicks the IdleReset periodically, then stop the thread
>>when you're done.
>>
>> --
>> Chris Tacke
>> Co-founder
>> OpenNETCF.org
>> Are you using the SDF? Let's do a case study.
>> Email us at d c s @ o p e n n e t c f . c o m
>> http://www.opennetcf.org/donate
>>
>>
>> "Boris Nienke" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> On Thu, 9 Jun 2005 14:51:53 -0400, Chris Tacke, eMVP wrote:
>>>
>>>> Yes. P/Invoke SystemIdleTimerReset.
>>>
>>> i've found this example:
>>> - to get the power-off time
>>> - then i would need a timer to call SystemIdleTimerReset
>>>
>>> Is this one correct?
>>>
>>> [DllImport ("coredll.dll")]
>>> private static extern int SystemParametersInfo(int uiAction , int
>>> uiParam,
>>> ref int pvParam, int fWinIni );
>>> [DllImport ("coredll.dll")]
>>> private static extern void SystemIdleTimerReset();
>>> public SystemParamsInfo(){}
>>>
>>> public static int GetSystemParameterTimeOutInfo()
>>> {
>>> int batteryIdle = 0;
>>> int acIdle = 0;
>>> int wakeUpIdle = 0;
>>> int shortestIdle = 0;
>>> SystemParametersInfo( SPI_GETBATTERYIDLETIMEOUT, 0, ref batteryIdle,
>>> 0);
>>> SystemParametersInfo( SPI_GETEXTERNALIDLETIMEOUT, 0, ref acIdle, 0);
>>> SystemParametersInfo( SPI_GETWAKEUPIDLETIMEOUT, 0, ref wakeUpIdle, 0);
>>> shortestIdle = batteryIdle;
>>> shortestIdle = ((acIdle > 0) && (acIdle < shortestIdle) ? acIdle :
>>> ((wakeUpIdle > 0) && (wakeUpIdle < shortestIdle)) ? wakeUpIdle :
>>> shortestIdle );
>>>
>>> return shortestIdle;
>>> }
>>>
>>>
>>> i'm asking because i also found a posting where someone's talking about
>>> problems with WM2003 (getting allways zero (0) from
>>> "GetSystemParameterTimOutInfo()"
>>>
>>> Boris
>>
>>