473,408 Members | 2,087 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Detecting an event

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
Nov 20 '05 #1
2 1361
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]
Nov 20 '05 #2
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.

"Tom Shelton" <to*@mtogden.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl...
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]

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Erik Bethke | last post by:
Hello All, I am trying to clean up some polish bugs with the Shanghai game I am working on and I am currently stuck on trying to get the right event for detecting when the user has changed the...
1
by: Erik Bethke | last post by:
Hello All, I am trying to clean up some polish bugs with the Shanghai game I am working on and I am currently stuck on trying to get the right event for detecting when the user has changed the...
2
by: Deano | last post by:
In my app I have lots of forms with data presented in various ways using all kinds of controls. Is there a simple way of detecting if the user has changed any data? I would like to do this so I...
2
by: Paul Steele | last post by:
Some time ago I tracked down the code for detecting the shutdown event within a C# program. I tested it, it worked, and I moved on. However, I just discovered that the code is no longer working,...
1
by: Tuong | last post by:
I have a situation where i have a form that contains a webbrowser control. With this I was able to implement an application that can browse websites. One particular website i visited opens up...
1
by: Dean Slindee | last post by:
In my application there is a main form with a tabcontrol. On each page in the tabcontrol is a panel upon which is painted a "sub" form. The main form acts as the "application host", while the...
7
by: jab3 | last post by:
Hello. I'm wondering if someone can answer something I'm sure has been answered a thousand times before. I am apparently just too dumb to find the answer. :) I've found information about the...
3
by: Greg | last post by:
The LostFocus event of datagrids is fired when the focus is added to a cell. How do you go about detecting it when the control as a whole has lost focus to another control? Slightly confused by...
1
by: wwwords | last post by:
Is there a general method for detecting that a user has changed the record currently visible on a form, whether this is by hitting PgUp or PgDn or clicking on a navigation button, even if no change...
15
by: RobG | last post by:
When using createEvent, an eventType parameter must be provided as an argument. This can be one of those specified in DOM 2 or 3 Events, or it might be a proprietary eventType. My problem is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.