473,657 Members | 2,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4704
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 FormClosingEven tArgs 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
335
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 exit the second instance. The problem is it doesn't bring the app out of the system tray. It works fine if the app is NOT in the system tray. How do I bring it out of the system tray and make it an active window? Thanks
5
7356
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 my mouse. If I don't hover over it to make it disappear and then open the program again, another one is added, resulting in a multiplicity of the icon in the tray. I've even tried setting its Visible property to false, followed by a call to the...
2
513
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 default. When the default MenuItem is clicked, there is code to no longer show the NotifyIcon. What I feel should happen is when I double-click the NotifyIcon in the system tray, it should perform the default menu item's Click event.
3
2102
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 steps). 1. Create a new Windows Forms C# solution (I called mine DBChanger). 2. Replace Form1.cs code with this: -------------------- using System;
0
1309
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 the tray icon to the new Icon a new icon appears in the system tray next to the original icon and the new icon will not resond to any events. Has anyone seen this?? Code snippet.... private Icon mDirIcon = new...
10
4828
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 point it becomes un-usable. The only fix I have found is to re-boot. Not a godd solution. How do I get this to stop happening? Environment C#, VS.Net 2003, XP Pro Thanks,
2
2916
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 the menu, it seems to disappear. This only breaks when the context menu is tied to a NotifyIcon - not to any other control. Below is a C# file for a form which should illustrate this (at least it does on my machine!). The same contextmenu is...
0
2012
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 does appears correctly in the system tray while the service is running but the context menu does not pop up when the icon is right clicked. Nor does the click event fire when the icon is clicked. Any suggestions?
5
2901
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 default, the system tray icon on click is supposed to show the console window I know window apps are usually the better solution for handling NotifyIcon class, but I would really like to know how to do it in console apps
3
3277
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 show a icon in the system tray. I've added a NotifyIcon and a button to a form: private void button1_Click(object sender, EventArgs e) { this.Visible = false; notifyIcon1.Visible = true; }
0
8395
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
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,...
0
8826
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, 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...
0
8732
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 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...
1
8503
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,...
1
6166
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
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
2
1615
bsmnconsultancy
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...

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.