Click here to Skip to main content
15,888,968 members
Home / Discussions / C#
   

C#

 
QuestionBackgroundWorker and STA threading model ? Pin
Christian Graus13-Apr-07 0:53
protectorChristian Graus13-Apr-07 0:53 
AnswerRe: BackgroundWorker and STA threading model ? Pin
Pete O'Hanlon13-Apr-07 0:56
mvePete O'Hanlon13-Apr-07 0:56 
GeneralRe: BackgroundWorker and STA threading model ? Pin
Christian Graus13-Apr-07 1:27
protectorChristian Graus13-Apr-07 1:27 
GeneralRe: BackgroundWorker and STA threading model ? Pin
Pete O'Hanlon13-Apr-07 1:41
mvePete O'Hanlon13-Apr-07 1:41 
GeneralRe: BackgroundWorker and STA threading model ? Pin
Christian Graus13-Apr-07 10:59
protectorChristian Graus13-Apr-07 10:59 
GeneralRe: BackgroundWorker and STA threading model ? Pin
Pete O'Hanlon15-Apr-07 9:18
mvePete O'Hanlon15-Apr-07 9:18 
Questionregioning, drag'n'drop & saving drafts Pin
xtremetechnology13-Apr-07 0:43
xtremetechnology13-Apr-07 0:43 
QuestionDetect system shutdown Pin
Bob Stanneveld13-Apr-07 0:11
Bob Stanneveld13-Apr-07 0:11 
Hello all,

I've developed a monitoring service which monitors some services and starts them when they are not running.

I found a problem when the server machine is shutting down and / or restarting. Windows is shutting down some services which are monitored before my monitoring service is shut down. Result is that my monitoring service detects that the service is not running and then starts the service. Windows continues to shut down and registry corruption is the result.

I thought that detecting whether the OS (Windows Server 2003) is shutting down would be a nice solution. However this is not an easy task. The OnShutdown() method is not called in my derived class. Furthermore I don't know when this method is invoked. Is it when the shutdown is initiated before the services are stopped, or is it invoked when the OS is stopping the services?

Is there a simple way to detect whether the OS is shutting down or restarting without responding to Windows messages / events?

I'm using the .NET framework 2.0

Thanks in advance,
Bob Stanneveld

Behind every great black man...
            ... is the police. - Conspiracy brother

AnswerRe: Detect system shutdown Pin
originSH13-Apr-07 0:17
originSH13-Apr-07 0:17 
AnswerRe: Detect system shutdown Pin
lucjon13-Apr-07 0:35
lucjon13-Apr-07 0:35 
GeneralRe: Detect system shutdown Pin
Bob Stanneveld13-Apr-07 1:02
Bob Stanneveld13-Apr-07 1:02 
AnswerRe: Detect system shutdown Pin
Dave Kreskowiak13-Apr-07 8:11
mveDave Kreskowiak13-Apr-07 8:11 
AnswerRe: Detect system shutdown Pin
Jupiter913-Apr-07 11:17
Jupiter913-Apr-07 11:17 
QuestionRe: Detect system shutdown Pin
Bob Stanneveld16-Apr-07 1:36
Bob Stanneveld16-Apr-07 1:36 
QuestionSmiley icon to be displayed in listbox. Pin
Nekshan12-Apr-07 23:57
Nekshan12-Apr-07 23:57 
AnswerRe: Smiley icon to be displayed in listbox. Pin
Christian Graus13-Apr-07 0:00
protectorChristian Graus13-Apr-07 0:00 
GeneralRe: Smiley icon to be displayed in listbox. Pin
Luc Pattyn13-Apr-07 1:54
sitebuilderLuc Pattyn13-Apr-07 1:54 
GeneralRe: Smiley icon to be displayed in listbox. Pin
Christian Graus13-Apr-07 10:54
protectorChristian Graus13-Apr-07 10:54 
AnswerRe: Smiley icon to be displayed in listbox. Pin
virendra patel13-Apr-07 0:02
virendra patel13-Apr-07 0:02 
GeneralRe: Smiley icon to be displayed in listbox. Pin
Obaid ur Rehman13-Apr-07 1:39
Obaid ur Rehman13-Apr-07 1:39 
QuestionProblem writing XML Pin
blackjack215012-Apr-07 23:41
blackjack215012-Apr-07 23:41 
AnswerRe: Problem writing XML Pin
Christian Graus12-Apr-07 23:46
protectorChristian Graus12-Apr-07 23:46 
GeneralRe: Problem writing XML Pin
blackjack215012-Apr-07 23:50
blackjack215012-Apr-07 23:50 
GeneralRe: Problem writing XML Pin
Christian Graus12-Apr-07 23:50
protectorChristian Graus12-Apr-07 23:50 
GeneralRe: Problem writing XML Pin
Dave Kreskowiak13-Apr-07 3:24
mveDave Kreskowiak13-Apr-07 3:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.