471,319 Members | 1,189 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Regarding applications running in the background.

Hi!

I have to write an application that runs in the background in the system
tray. It should listen to keyboard events and send messages to another
program that is currently active. Can anyone suggest me solution.

Thank you,


Feb 9 '06 #1
5 3509
> I have to write an application that runs in the background in the system
tray
Use BackgroundWorker or create separate thread.
It should listen to keyboard events and send messages to another
program that is currently active. Can anyone suggest me solution.


You ony have to handle keydown event(s) and communicate with the program you
want.
PK
Feb 9 '06 #2
Hello, Aravind!

A> I have to write an application that runs in the background in the
A> system tray. It should listen to keyboard events and send messages to
A> another program that is currently active. Can anyone suggest me
A> solution.

Listeting program establishes win32 keyboard hooks
( http://www.codeproject.com/csharp/NetWin32Hooks.asp )
( http://support.microsoft.com/kb/318804/ )

Also you have to choose the way of communication, at your disposal are the following ways:
- sockets
- named pipes
- remoting
- memory mapped files
- windows messages ( e.g. WM_COPYDATA )
etc.
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Feb 9 '06 #3
Thank you for your reply. I have to write seperate application that listens
both keyboard n mouse events. It should send messages to another application
(active application) whenever some set of keys are pressed. Does Key hooks
solve my problem or do I need to use BackgroundWorker class??

Thanx

Aravind.

"PiotrKolodziej" wrote:
I have to write an application that runs in the background in the system
tray


Use BackgroundWorker or create separate thread.
It should listen to keyboard events and send messages to another
program that is currently active. Can anyone suggest me solution.


You ony have to handle keydown event(s) and communicate with the program you
want.
PK

Feb 9 '06 #4
Thank you I will try ur suggestions.

"Vadym Stetsyak" wrote:
Hello, Aravind!

A> I have to write an application that runs in the background in the
A> system tray. It should listen to keyboard events and send messages to
A> another program that is currently active. Can anyone suggest me
A> solution.

Listeting program establishes win32 keyboard hooks
( http://www.codeproject.com/csharp/NetWin32Hooks.asp )
( http://support.microsoft.com/kb/318804/ )

Also you have to choose the way of communication, at your disposal are the following ways:
- sockets
- named pipes
- remoting
- memory mapped files
- windows messages ( e.g. WM_COPYDATA )
etc.
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot

Feb 9 '06 #5
Why to use thread or backgroundWorker.

Answer. When you press button your application raises an event.
Then you are sending info to other application.
During the sending time, your applicatiion has a "lag".
When you create a seperate thread for sending data, you'r events might be
handled in the same time you are sending info to other program.

If i were you i'd use one thread for sending info, and handle events that i
need to be handled.
If you need info how to create thread you can shoot me emal if you want.

PK
Feb 9 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Cowboy \(Gregory A. Beamer\) | last post: by
reply views Thread by satya | last post: by
1 post views Thread by trialproduct2004 | last post: by
3 posts views Thread by Henry | last post: by
reply views Thread by rosydwin | last post: by

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.