473,394 Members | 1,956 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,394 software developers and data experts.

NotifyIcon (System Tray)

Hi,

I have created a System Tray application using C# for .NET 2.0.
My PC will not shut down or make a restart if my System Tray application is
working at the Tray.
Only after I end the process of my System Tray application then my PC is
able to do a shut down or Restart.

Any help for solving this problem will be much appreciated.

Kind Regards,
Asaf

Apr 12 '07 #1
3 4686
The OnClosing event handler is the problem here. Follow the link below for
the solution.

http://www.pixvillage.com/blogs/devb...03/26/174.aspx

"Asaf" wrote:
Hi,

I have created a System Tray application using C# for .NET 2.0.
My PC will not shut down or make a restart if my System Tray application is
working at the Tray.
Only after I end the process of my System Tray application then my PC is
able to do a shut down or Restart.

Any help for solving this problem will be much appreciated.

Kind Regards,
Asaf
Apr 12 '07 #2
Hi Asaf,

When we shut down or restart a machine, it will end all processes running
on it first. If there's a process that could not be terminated, the
shutting down or restarting operation won't succeed.

I agree with Naeem. A possible reason of your problem is that you have
handled the FormClosing event or override the OnFormClosing method to
prevent the application from being ended by setting the Cancel property of
the FormClosingEventArgs parameter to true.

I have performed a test on Naeem's solution and confirmed it works.

If the problem is still not resolve by Naeem's solution, please feel free
to let me know and if possible, you may send me a sample project that could
just reproduce the problem. To get my actual email address, remove 'online'
from my displayed email address.
Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 13 '07 #3
Thanks Naeem for your help!

"Naeem" wrote:
The OnClosing event handler is the problem here. Follow the link below for
the solution.

http://www.pixvillage.com/blogs/devb...03/26/174.aspx

"Asaf" wrote:
Hi,

I have created a System Tray application using C# for .NET 2.0.
My PC will not shut down or make a restart if my System Tray application is
working at the Tray.
Only after I end the process of my System Tray application then my PC is
able to do a shut down or Restart.

Any help for solving this problem will be much appreciated.

Kind Regards,
Asaf
Apr 13 '07 #4

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

Similar topics

1
by: John | last post by:
I use NotifyIcon to minimize my app to the system tray. I also check everytime my app runs for the previous instance, if it is running, call SetForegroundWindow to bring its window up front and...
5
by: Phil Galey | last post by:
VB.NET 2002 on Windows 2000 SP 3 When I start my program, the NotifyIcon appears in the tray, as it should. However, when I close the program, the NotifyIcon remains until I hover over it with...
2
by: Rob Mayo | last post by:
OK, maybe this is my opinion, maybe these are bugs. Given the folowing: I have a NotifyIcon on my Form, a Context menu associated with the NotifyIcon, and a MenuItem on the ContextMenu set as...
3
by: Me | last post by:
I'm getting a NullReferenceException in Unknown Module when I follow the below steps to create a simple NotifyIcon app that creates the context menu on the fly(see a little analysis after the...
0
by: Dick Abram | last post by:
I have a project that uses the NotifyIcon to put an icon in the system tray. At some point in the application I change the .Icon property of the object to another Icon object but instead of changing...
10
by: james | last post by:
My app has a notify Icon, but after the app exits, the Icon is still visible, and then when I runthe app multiple times I get multiple icons so that my status bas keeps accumulating them to the...
2
by: Derrick | last post by:
I've been working on an application which has a NotifyIcon (system tray icon), and a corresponding ContextMenu. I want to be able to update this menu dynamically. However, when I make changes to...
0
by: Neo | last post by:
I have created a Windows Service that shows a notifyicon in the system tray. I have also created a context menu for the notifyicon and implemented the notifyicons click event. The notifyicon...
5
by: celestialgal86 | last post by:
Hi everyone... I'm a starter at .Net programming, and I need some help. I was asked to develop a console app that will auto-hide the console window and show a system tray icon. And by...
3
by: Peter Holschbach | last post by:
Hi all, I've a application where I need to use NotifyIcon in a other way round. My normal windows application sometimes has to collect data. In this case I want to hide all formulares and just...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.