Re: Detecting Idle time ????

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Mouse hooking does not work. In fact while keyboard hooks work, they are
also not "supported" meaning there's no guarantee they won't disappear in a
future version.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com


"MSP" <MSP@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AC108716-7045-4AA5-887A-935D7A1C56DA@xxxxxxxxxxxxxxxx
Thanks guys.

Before trying the way you mentioned here, i thought of trying to cature
the global keyboard and mouse messages, based on that
i can calculate the idle time (considering only keyboard and mouse
interaction).

I could installl the keyboard hook successfully but mousehook.
I want to know whether mouse hook is supported in windows ce or not?
If yes, could please tell me where can i get the WH_MOUSE value to define?
(For Ex: #define WH_KEYBOARD 20)

If no, could you please give me some more information about the method
which
you guys have suggested?
***********************
You could, in the interrupt handler, do something that is completely
specific to your platform (set an event every time there's a keyboard or
mouse input, for example). Your application could, in a thread,
WaitForSingleObject() on that event with a time out. If the call dropped
through with a time out, rather than the event, indication, there's been a
time out period of inactivity and you can do whatever you want.
***********************
If i need to set event an eveny for keypress/mouse action whether i need
to
do it in
the respective driver or somewhere else?

Help Me Out...



"Paul G. Tobey [eMVP]" wrote:

True.

Paul T.

"Dean Ramsier" <ramsiernospam@xxxxxxxxxx> wrote in message
news:%23lEXgUztHHA.3356@xxxxxxxxxxxxxxxxxxxxxxx
That would work. Except if he has access at that level, then there is
no
reason he couldn't leverage the power manager instead, which already
has
all the user activity info :)

I'm guessing that for whatever reason he can't modify the OS at all
(maybe
he's not the OEM?)

-
Dean Ramsier - eMVP
BSQUARE Corporation


"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT
com> wrote in message news:eqxQU8NtHHA.2124@xxxxxxxxxxxxxxxxxxxxxxx
You could, in the interrupt handler, do something that is completely
specific to your platform (set an event every time there's a keyboard
or
mouse input, for example). Your application could, in a thread,
WaitForSingleObject() on that event with a time out. If the call
dropped
through with a time out, rather than the event, indication, there's
been
a time out period of inactivity and you can do whatever you want.

Paul T.

"Dean Ramsier" <ramsiernospam@xxxxxxxxxx> wrote in message
news:%23Gu83jMtHHA.3364@xxxxxxxxxxxxxxxxxxxxxxx
I don't know of any way that you can, without help from the Power
Manager. And since you can't include it I don't know how you're going
to
do it. Might be a way, I just don't know what it is...

--
Dean Ramsier - eMVP
BSQUARE Corporation


"MSP" <MSP@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4EB2C596-294E-46DF-87AB-49440F019176@xxxxxxxxxxxxxxxx
Thanks Riki. I have gone thru' the link which you mentioned
*****************
Platform Builder for Microsoft Windows CE 5.0
Suspend Time-out Support

You may want your Windows CE-based device to enter a suspend state
after a
period of inactivity. You can enter a suspend state in the following
ways:

1.GWES can maintain an idle timer based upon user input and suspend
the
system after a period of inactivity. This is the method used in
versions of
Windows CE prior to Microsoft® Windows® CE .NET 4.1.
2.The Power Manager can actively manage system power states based on
activity timers, power source, and other input methods. You can
customize the
Power Manager to suspend the system when you choose.
3.You can write an application outside of GWES and the Power Manager
that
decides when to suspend the system. In this scenario, both GWES and
the
Power
Manager must be configured to not manage suspend states.
In all three of these scenarios, the Power Manager is responsible
for
suspending the system by calling PowerOffSystem. The scenarios
differ
primarily in how you change the system power state to a suspend
state.
Only
one of the methods should be used to avoid conflicts between GWES,
the
Power
Manager and your application.

If the Power Manager is managing time-outs on your OS the
SystemIdleTimerReset function informs GWES that a screen saver
should
not
appear.

**********************
In my case, it seems that i have to follow the 3rd method. But the
problem
is that
i am not aware how can i detect the user idle time?
Can anybody help me out in this?

-M.S.Pathy

"Riki" wrote:

MSP wrote:
Hi all

I am working in Windows CE platform.
I just want to write an application which should
detect the idle time (No input from keyboard and mouse,
no device should be plugged/unplugged etc..No interaction at all)
and shut down the system if the
idle time crosses a threshold value.

Can i use GetIdleTime()?
Is there any standard API to detect the idle time?
I guess for desktop OS, we have "GetLastInputInfo()" which
retrieves the time of the last input event.
GetIdleTime() exists on CE, if the OEM has implemented it. But that
doesn't do what your after.

See Suspend Time out Support:
http://msdn2.microsoft.com/en-us/library/ms894052.aspx

Riki

--
ThemeChanger and AbstractStart for Smartphone :
http://www.IfIHadADollarForEveryTimeSomeoneSaidThatIWouldHaveMyOwnWebsite.com/
Windows CE Base Team Blog:
http://blogs.msdn.com/ce_base/

For every giraffe I find, I shall kill you












.



Relevant Pages

  • Re: Detecting Idle time ????
    ... of their keyboard and mouse codes. ... background and monitor the user idle time and so something. ... use Dean's suggestion and add the power manager and use what it already ... Suspend Time-out Support ...
    (microsoft.public.windowsce.embedded)
  • Re: Detecting Idle time ????
    ... i can calculate the idle time (considering only keyboard and mouse ... Suspend Time-out Support ... 2.The Power Manager can actively manage system power states based on ...
    (microsoft.public.windowsce.embedded)
  • Re: Detecting Idle time ????
    ... background and monitor the user idle time and so something. ... use Dean's suggestion and add the power manager and use what it already ... I want to know whether mouse hook is supported in windows ce or not? ... Suspend Time-out Support ...
    (microsoft.public.windowsce.embedded)
  • Re: Detecting Idle time ????
    ... using Platform Builder on a daily basis to try to make this work? ... use Dean's suggestion and add the power manager and use what it already does ... i can calculate the idle time (considering only keyboard and mouse ... Suspend Time-out Support ...
    (microsoft.public.windowsce.embedded)
  • Re: Detecting Idle time ????
    ... It seem he is not having access to platform builder and he is not a OEM. ... background and monitor the user idle time and so something. ... use Dean's suggestion and add the power manager and use what it already does ... Suspend Time-out Support ...
    (microsoft.public.windowsce.embedded)