Re: Detecting Idle time ????
- From: MSP <MSP@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 12 Jul 2007 08:04:15 -0700
Thanks one and all.
After very long discussion and time, my client has accepted to give the source
of their keyboard and mouse codes.
Now am planning to broadcast a message whenever there is a keypress/mouse
action
and now my application will wait for this message, if it comes then it reset
the timer otherwise my application shuts down the system..
Could you please tell me is this a right approach??
Thanks again
"Paul G. Tobey [eMVP]" wrote:
If that's the case, it can't be done using my method, either. There is not,.
necessarily, a global event that you can catch to indicate, "Ah, here is
some user activity." Consult the device OEM for information on what, if
anything, they *do* provide and, if they don't provide anything, ask them to
help you. We can't.
Paul T.
"RAC" <RAC@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:76AA4A00-DF6D-4D05-BA5E-2421B582484D@xxxxxxxxxxxxxxxx
It seem he is not having access to platform builder and he is not a OEM.
He wants to implement the application which will run as service in
background and monitor the user idle time and so something.
"Paul G. Tobey [eMVP]" wrote:
Back up. You are developing the operating system for this device? You
are
using Platform Builder on a daily basis to try to make this work? If so,
use Dean's suggestion and add the power manager and use what it already
does
to figure out when the unit is idle. Why are you resisting so
aggressively
doing this the 'right' way?
Paul T.
"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 allGetIdleTime() exists on CE, if the OEM has implemented it. But
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.
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
- Prev by Date: Re: CE 4.2 Power Manager - Open Handles
- Next by Date: Re: Deploying Embedded CE 6.0 development app
- Previous by thread: CE 4.2 Power Manager - Open Handles
- Next by thread: exFAT documentation
- Index(es):
Relevant Pages
|