Detecting an event

  • Thread starter Thread starter Milan Todorovic
  • Start date Start date
M

Milan Todorovic

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
 
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,
Unfortunately, I was excepting the an answer like that.
Using C/C++ is no problem, but I have no idea where to start. While I
understand what you are telling me I have no clue how to implement it; my OS
programming knowledge does not extent that far.
Can you suggest any references: books, CS papers, websites where I can start
getting some idea what I actually need to do.
Thanks
Milan
PS. My apologies that this question steps out of the boundaries of this
newsgroup.
 
Back
Top