Boris
Mon Jun 13 01:22:14 CDT 2005
The shortest time i can set on my device is 1 minute. It seems to be the
same on other devices too.
Now i've set a timer to 30 seconds to call the reset - it works!
Thanks A LOT! That saved my day!
Boris
On Fri, 10 Jun 2005 08:43:02 -0700, Paul G. Tobey [eMVP] wrote:
> That depends. You can configure the device to go to sleep pretty darn fast.
> As long as the time-out is longer than the period on which you are repeating
> your calls, yes, it should work.
>
> Paul T.
>
> "Boris Nienke" <nospam@nsonic.de> wrote in message
> news:o7ew0db8c5o0$.1bhazb8ts5tds$.dlg@40tude.net...
>> 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" <ctacke@spamfree-opennetcf.org> wrote in message
>>> news:%231Un5XTbFHA.2124@TK2MSFTNGP14.phx.gbl...
>>>>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" <nospam@nsonic.de> wrote in message
>>>> news:1ezi4rvbs5guw.1lkg5wqfatcfr.dlg@40tude.net...
>>>>> 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
>>>>
>>>>