473,507 Members | 2,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

tray program + external applications

Hi there. Can anyone point me to some good references or examples on how to
create an independent tray program that can send triggers to external
applications all designed inside the same solution?

Basically, I want a tray program with a context menu of options (they can be
checked or unchecked options) that when an action is taken gets triggered to
all the other open applications of the solution. I've already created the
tray program, but I don't know how to accomplish the second part. For now,
I have it set up to show the state of these checks in the registry, and each
application on a timer of one second checks for changes in the registry.
Obviously, this is not the best way.
Nov 20 '05 #1
4 1766
Robert Samuel White wrote:
Hi there. Can anyone point me to some good references or examples on
how to create an independent tray program that can send triggers to
external applications all designed inside the same solution?

Basically, I want a tray program with a context menu of options (they
can be checked or unchecked options) that when an action is taken
gets triggered to all the other open applications of the solution.
I've already created the tray program, but I don't know how to
accomplish the second part. For now, I have it set up to show the
state of these checks in the registry, and each application on a
timer of one second checks for changes in the registry. Obviously,
this is not the best way.


You could use .Net Remoting. This has the advantage of being easily
extendable to have your applications communicate over a network, and it also
has the advantage of being strictly managed code.
http://msdn.microsoft.com/library/en...ngoverview.asp

If you're willing to delve into Win32 API calls, there are a few options for
Interprocess Communication, the most useful of which would probably be
pipes.
http://msdn.microsoft.com/library/en...base/pipes.asp

--
Sven Groot

http://unforgiven.bloghorn.com

Nov 20 '05 #2
Thanks, Sven, I'm going to look into this. I'd prefer to stick with .NET
rather than deleve into the Win32 API as I've never done that. I've
primarily developed in Access, Visual Basic, Pascal, Java, and PHP.

Do you happen to know how to check for a running application? And if it is
not running, to execute it? I'm not sure where to start. Basically, the
front-end applications need to check to see if the tray program is even
running. If it's not, then it needs to open it up. From there, the tray
program forces the user to log in before the front-end applications may be
accessed.

I'm trying to port a sophisticated multi-user, networked, multi-database,
multi-application suite written in Access to .NET.

-Samuel
http://rswfire.com
http://enetwizard.net
"Sven Groot" <sv*******@gmx.net> wrote in message
news:e1**************@TK2MSFTNGP10.phx.gbl...
Robert Samuel White wrote:
Hi there. Can anyone point me to some good references or examples on
how to create an independent tray program that can send triggers to
external applications all designed inside the same solution?

Basically, I want a tray program with a context menu of options (they
can be checked or unchecked options) that when an action is taken
gets triggered to all the other open applications of the solution.
I've already created the tray program, but I don't know how to
accomplish the second part. For now, I have it set up to show the
state of these checks in the registry, and each application on a
timer of one second checks for changes in the registry. Obviously,
this is not the best way.
You could use .Net Remoting. This has the advantage of being easily
extendable to have your applications communicate over a network, and it

also has the advantage of being strictly managed code.
http://msdn.microsoft.com/library/en...ngoverview.asp
If you're willing to delve into Win32 API calls, there are a few options for Interprocess Communication, the most useful of which would probably be
pipes.
http://msdn.microsoft.com/library/en...base/pipes.asp

--
Sven Groot

http://unforgiven.bloghorn.com

Nov 20 '05 #3
Robert Samuel White wrote:
Do you happen to know how to check for a running application? And if
it is not running, to execute it? I'm not sure where to start.
Basically, the front-end applications need to check to see if the
tray program is even running. If it's not, then it needs to open it
up. From there, the tray program forces the user to log in before
the front-end applications may be accessed.


There are typically three ways in which an application can check if an
instance of itself or another application is already running. One is
enumerating all windows looking for one with a specific title (for a tray
app this window would typically be invisible). One is checking the list of
running process to see if the executable is running. The last one is using
named pipes. The application that needs to be checked typically creates a
named pipe, and the application that does the checking tries to connect to
it. If that works, the application is running.

Unfortunately, only the last one is a truly robust method, and as it
requires pipes so it can't be done in pure .Net. The behaviour however can
be emulated using .Net Remoting. Simply have the tray app be a host
application, have it listen on some port with some URI (see the link I
provided with info on how to do all this, it contains a very simple example
of a host and client app), then have the other application be a client, and
attempt to connect to the remoting channel on the localhost. If that fails,
the tray app is not running, so you must launch it using CreateProcess.

For all the communication the other way around, the tray app is the remoting
client to the other applications, which act as host in that scenario.

I suggest you read the documentation on .Net Remoting thoroughly.

--
Sven Groot

http://unforgiven.bloghorn.com

Nov 20 '05 #4
Sven Groot wrote:
channel on the localhost. If that fails, the tray app is not running,
so you must launch it using CreateProcess.


Oops, CreateProcess is Win32 API, use Process.Start in .Net.

--
Sven Groot

http://unforgiven.bloghorn.com
Nov 20 '05 #5

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

Similar topics

9
6947
by: none | last post by:
Hello all, I wrote a shell program a few years ago in VB6 that needs to be modified. The problem I have is this: The SysAdmin uses this shell in place of Explorer, so there is no taskbar. When...
3
9713
by: joe | last post by:
Hi guys, Is there any way to refresh the system tray. Every time the explorer crashes the notify icons are removed and I cannot see them when it comes back even when my application is running....
10
3653
by: One Handed Man [ OHM ] | last post by:
If this is duplicated, I'm sorry because I cant find the original post I made today Anyway . . Now its my turn to ask a question I want to develop an app which will run in the system tray....
5
2623
by: Casper | last post by:
I'm trying to get my program to run in the system tray. I've looked at dozend of tutorials on the web and on newsgroups but I just dont get it! Has anyone got any links or example code that ...
4
5635
by: Tom | last post by:
Hello, System tray icon informs users that the apps is running in the background. However, there are instances that the app might crash and after that the app icon in the system tray is still...
6
4751
by: MLH | last post by:
I am unsure how to do this. I want this tray to be used for certain print jobs - jobs that will prompt me to load the bypass tray with sheet labels. How to force this? Dunno. Its the HP LaserJet...
3
7911
by: Patrick Dugan | last post by:
I am using VS2005 (vb) and I have a program that starts when Windows boots up. Occasionally the icon that should appear in the system tray does not show up. The program is still running in memory...
0
1134
vdraceil
by: vdraceil | last post by:
Hi all,does anyone know how to remove an icon(of some other application) from the system tray without the process of that application being affected? can SHELL_NOTIFYICON be used for this...
0
7223
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
7377
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...
1
7034
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7488
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...
1
5045
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...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.