Unable to proper shutdown
-
Hi all... I have created a program that checks system's processor's ID and some registry keys before starting. After that it works in background. The problem is here that when the program is in execution and I am trying to shutdown my system then my system is not shutting down and the problem is that Windows is unable to kill my program's execution forcefully or something like that. How to solve this problem, suggest me. Thanks. Gagan
-
Hi all... I have created a program that checks system's processor's ID and some registry keys before starting. After that it works in background. The problem is here that when the program is in execution and I am trying to shutdown my system then my system is not shutting down and the problem is that Windows is unable to kill my program's execution forcefully or something like that. How to solve this problem, suggest me. Thanks. Gagan
did you do anything special to get that? is your app windowless? maybe SystemEvents.SessionEnding could help you out. :)
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
-
did you do anything special to get that? is your app windowless? maybe SystemEvents.SessionEnding could help you out. :)
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Well, I am getting processor's ID by importing System.management namespace and bye creating objects of ManagementObject and ManagementObjectSearcher and getting registry keys by using my.computer.registry class. Could you explain me your solution or do you have any piece of code? Thanks. Gagan
-
Well, I am getting processor's ID by importing System.management namespace and bye creating objects of ManagementObject and ManagementObjectSearcher and getting registry keys by using my.computer.registry class. Could you explain me your solution or do you have any piece of code? Thanks. Gagan
-
Hi all... I have created a program that checks system's processor's ID and some registry keys before starting. After that it works in background. The problem is here that when the program is in execution and I am trying to shutdown my system then my system is not shutting down and the problem is that Windows is unable to kill my program's execution forcefully or something like that. How to solve this problem, suggest me. Thanks. Gagan
hi man, sounds like you have override the OnClosing / OnClose functions. And in there you set the EventArgs.Cancel to true?!? if you do this you need to check the CancelEventArguments for a CloseReason. in that case cast the CancelEventArgs to FormClosingEventArgs and check the Property CloseReason for CloseReason.WindowsShutdow,etc.. before setting args.Cancel to true. hope i could help :) bless