views:

136

answers:

1

I am about to start working on application that runs in the background waiting for a certain user input somewhat like apple's spotlight. Basically the user will give the service a certain key that will bring it up (for example the user might hit control-space or control-p) then the application main GUI will be brought up.
Now my questions: First, I want this application to have a very small footprint and not draw on many system resources, and not interfere with the operation of other applications. I also would like to write this application in C#. So far the best idea I have had would be to write a service that listened for key strokes and threw away stroke that were not either the control or following a control key. This does not seem optimal is there a better way, anyone know how spotlight works?
Second, I am concerned that this kind of service might be identified as mall ware. What steps might I take to insure that my software is not targeted by applications such as Avast and Spysweeper? Would I need to contact all of the manufacturers of these software packages and explain the purpose of my application?
Finally, if anyone could link to resources about how to set up such a service I would greatly appreciate it.

+2  A: 

Services are not supposed to interact with the desktop user, as such they aren't supposed to be able to hook and watch for keystrokes. This may work on XP but you will likely have many problems on Vista/7 and later OS's.

You really need a userspace program that runs at user startup to do this that runs as the same user as the logged in user.

Also, if you are concerned about minimal footprint and resource usage, you don't want to be using .NET because it needs to load a fairly large runtime library and creates a fairly big working set. Usually this isn't a problem, but for something like a watcher program, it's best to write it in low footprint C using a low footbring minimal CRT startup.

Mystere Man
Your first points are valid. But an ngen'd .NET app will load up plenty fast enough for this type of app.
Frank Krueger
I didn't say anything about speed. I'm not sure why you are commenting about it? I'm referring to memory footprint.
Mystere Man