Hi there,
we are creating some automated backup solution for some user application (let's say "UserApp" ;)). Now, the backup service is working perfectly.
But there's a problem: the backups cannot be created if some user is working with the "UserApp" at the same time, because of locked files, etc. So the service should be able to tell the user to close the application and wait until the user does.
As I already know that a service shouldn't (and since Vista: CANNOT) communicate with the user "directly", I thought of a system tray icon where the user also could see whether the service is running.
Now I also partly created such a tray app and it is working well so far.
My big problem is now, that I don't have a clue about creating a client-service-communication. As said, I want the service to send some sort of message to the system tray application, which then perhaps translates that message and informs the user with a ballon tip for example.
Is there a simple way to achieve this?
How would you going to do this?
Which sort of communication would you use? IPC? Pipes? Sockets?
I have read many articles and threads about this topic, but I couldn't find any proper solution and/or how to implement that.
Thanks in advance for helping me ;)
Greetings
Lawyno
5 3638
Is there really no one, who can help me?
I really need a solution very soon and I'm stuck with this one :(
PRR 750
Recognized Expert Contributor
You could use Named Pipes... You can also look into WCF...
A simple approach would be write to a file (in a specified folder) and have your windows form app watch it... Read from file and display the status ... Just make sure your win form app has rights to read the file ...
@DeepBlue
Thx for the reply ;)
I also thought of named pipes. But how do I implement named pipes in C# (or .NET)?
I've read those msdn articles, but they are written for C++ and it seems to me that those methods are not available for C#.
Perhaps I'm searching with the wrong words, but I didn't find any (good) articles/tutorials about implementing named pipes in C# (or .NET).
So can you (or somebody else) please tell me how to do this?
Thank you & have a nice day ;)
Lawyno
Well I somehow managed to get it to work with IPC in the meantime. :)
Working myself through that complicated C#-Named-Pipes-With-Native-Methods-Wrapper-Stuff would have been too much overhead, compared to my (simple) solution.
Thanx anyway ;)
Lawyno
Sign in to post your reply or Sign up for a free account.
Similar topics |
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 his users run PC Anywhere from the shell, and minimize
it, it minimizes to the system tray. With no task bar, there is no
system tray, so there is no way to restore the PC Anywhere window.
The shell starts PC Anywhere using ShellExecute. I...
|
by: Carlos Natal |
last post by:
Hi all,
While creating a windows service using .NET and C# I had to call
myForm.ShowDialog() from within a thread I have created inside the OnStart()
method.
When this window is closed, my thread terminated and the tray icon displayed
is removed. The service runs ok while the user is logged on the system.
When the user logs off, all windows are closed (including the one from my
service - I used 'Service Interacts with Desktop') but...
|
by: Andrew Mueller |
last post by:
Hello all,
I have created a windows service and now I would like to have a
configuration page in the system tray. Basically an icon I can click on
which will just interact with an XML file. What is the best way to do this?
1. How do I use the System Tray and add an icon on it. Yes, probably
basic.. and I can do it with VB but have never tried with C#.
Andrew Mueller
|
by: Mats-Lennart Hansson |
last post by:
Hi,
I'm having a hard time getting my service to show a sys tray icon. I've
tried to create a separate Windows application where I simply add a
notification icon to the form. In the OnStart method of the service I simply
try to start the windows application which then should show the icon.
I can't get it to work! When I run the separate Windows application the icon
turns up, but when I start it from the service it doesn't. How should I...
|
by: utkarsh |
last post by:
Hi,
I want to develop a Window Service in C# that should be capable of
sisplaying the a icon in the window tray.
Based on some logic in service, icon should be changed to some other
color/image and I needed single click, double click event and context
menu also on that tray icon to perform some other operation and show
some window form.
| |
by: Amongin Ewinyu |
last post by:
Hi,
I have an application that is controlled by a service. when the service
starts, an icon is supposed to be placed in the system tray and this icon is
then used to display a balloon intermittently. the problem is that when the
icon is placed in the balloon and for some time after this, it is visible in
the system tray, but after some time if i try to hover the mouse over the
icon, it then disappears, although i still get a message...
|
by: Jay |
last post by:
Hey There,
I have a system tray application that is running, and it needs to
communicate with a Windows Service that I wrote. My problem is that if
a user switches to another desktop, I need the service to have
communication be able to distinguish that data needs to be sent to app
A instead of app B. I was going to try to use a desktop handle to
distinguish between the two, but I can't create the service as an
interactive service (nor...
|
by: salahuddin23 |
last post by:
I am making a program to run my windows service from system tray, i added Service controller class and all is woking except to put it in system tray. As in VB.NET we can have Application.Run() method in Main(). I am unable to do same in C#. Please some one help me. and if possible give me sample code program in C# to put it in system tray and when i click on it - a form which come that i will design.
Thanx in advance.
|
by: Joseph Geretz |
last post by:
The conventional approach is easy enough; drop a NotifyIcon onto a Form.
When the form is loaded - bingo - the icon appears in the System Tray.
I can't use this approach though. I'm writing a service. But I'd like my
service to install an icon on the System Tray so that the user can start /
stop / and otherwise control the service interactively, and without having
to go to the Services applet. How do I do this?
Thanks for your advice.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |