In article <ev**************@tk2msftngp13.phx.gbl>, Milan Todorovic wrote:
I need to write a service (or a background app) to perform a certain set of
action if no keybord input or mouse movements have been made in a given
time.
Now, I know that vb.net can detect the such events within the form, but I
need this to be system wide, since there will be no form.
Is there a simpler way to do this or are APIs my only option. If so, I need
a pointer.
Thanks a lot
Milan
Not only are API's the only way to do it - you can't do this from
VB.NET. You have to write the actuall hook procedure in a language that
supports native dlls - such as C++. The reason for this is that you
have to expose your hook as an entry point in a dll so that Windows can
inject it into the hook chain. What that means is - that you can't do
this in any .NET langauge (or VB.CLASSIC for that matter) with out
writing some code in another language. If C/C++ is a problem for you, I
might suggest PowerBASIC (
www.powerbasic.com) since the windows compiler
(not the console compiler) allows you to create native dlls and you get
to use a BASIC syntax very similar to VB.CLASSIC.
--
Tom Shelton
MVP [Visual Basic]