Click here to Skip to main content
15,925,133 members
Home / Discussions / C#
   

C#

 
AnswerRe: Detect system shutdown Pin
Dave Kreskowiak13-Apr-07 8:11
mveDave Kreskowiak13-Apr-07 8:11 
You can call the Win32 API function RegisterServiceCtrlHandlerEx[^] to register your service to receive window message-based notification, like WM_QUERYENDSESSION or WM_ENDSESSION.

But, there's a downside to doing this. Once you call RegisterServiceCtrlHandlerEx, the normal ServiceBase's control handlers, like OnStart, OnStop, ..., will no longer work. You'll have to handle the Service Control messages and do the dispatching to your handlers yourself.

Sorry, I don't have any examples handy.


Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


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 
Questionprolog dll Vs c# or C++ ,how and why? Pin
ismail marmoush12-Apr-07 23:38
ismail marmoush12-Apr-07 23:38 
AnswerRe: prolog dll Vs c# or C++ ,how and why? Pin
Christian Graus12-Apr-07 23:50
protectorChristian Graus12-Apr-07 23:50 
GeneralRe: prolog dll Vs c# or C++ ,how and why? Pin
ismail marmoush13-Apr-07 0:01
ismail marmoush13-Apr-07 0:01 
GeneralRe: prolog dll Vs c# or C++ ,how and why? Pin
Christian Graus13-Apr-07 0:15
protectorChristian Graus13-Apr-07 0:15 
GeneralRe: prolog dll Vs c# or C++ ,how and why? Pin
Dan Neely13-Apr-07 2:11
Dan Neely13-Apr-07 2:11 
GeneralRe: prolog dll Vs c# or C++ ,how and why? Pin
ismail marmoush13-Apr-07 5:07
ismail marmoush13-Apr-07 5:07 
AnswerRe: prolog dll Vs c# or C++ ,how and why? Pin
sujithkumarsl13-Apr-07 0:55
sujithkumarsl13-Apr-07 0:55 
GeneralRe: prolog dll Vs c# or C++ ,how and why? Pin
ismail marmoush13-Apr-07 0:58
ismail marmoush13-Apr-07 0:58 
GeneralRe: prolog dll Vs c# or C++ ,how and why? Pin
sujithkumarsl13-Apr-07 1:08
sujithkumarsl13-Apr-07 1:08 
Question[Message Deleted] Pin
sulabh202012-Apr-07 22:41
sulabh202012-Apr-07 22:41 
AnswerRe: How to add bullets to word document using c# Pin
Christian Graus12-Apr-07 23:04
protectorChristian Graus12-Apr-07 23:04 

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.