Click here to Skip to main content
15,905,316 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Delaying Shutdown through windows service and executing scripts ? Pin
David Crow22-Oct-09 3:02
David Crow22-Oct-09 3:02 
QuestionRe: Delaying Shutdown through windows service and executing scripts ? Pin
Randor 22-Oct-09 3:08
professional Randor 22-Oct-09 3:08 
GeneralRe: Delaying Shutdown through windows service and executing scripts ? Pin
Kushagra Tiwari22-Oct-09 3:24
Kushagra Tiwari22-Oct-09 3:24 
QuestionRe: Delaying Shutdown through windows service and executing scripts ? Pin
Randor 22-Oct-09 3:30
professional Randor 22-Oct-09 3:30 
AnswerRe: Delaying Shutdown through windows service and executing scripts ? Pin
Kushagra Tiwari22-Oct-09 3:39
Kushagra Tiwari22-Oct-09 3:39 
GeneralRe: Delaying Shutdown through windows service and executing scripts ? Pin
Randor 22-Oct-09 3:49
professional Randor 22-Oct-09 3:49 
AnswerRe: Delaying Shutdown through windows service and executing scripts ? Pin
Kushagra Tiwari22-Oct-09 3:47
Kushagra Tiwari22-Oct-09 3:47 
AnswerRe: Delaying Shutdown through windows service and executing scripts ? Pin
Covean22-Oct-09 3:42
Covean22-Oct-09 3:42 
To catch the Shutdown-Event you have to handle SERVICE_CONTROL_SHUTDOWN or SERVICE_CONTROL_PRESHUTDOWN
event in your HandlerEx callback function you registered with RegisterServiceCtrlHandlerEx.
(To use this, you need to say the system that your service supports shutdown events.

An other possibility is to use the SetConsoleCtrlHandler function where you handle the CTRL_SHUTDOWN_EVENT event in your HandlerRoutine.

After you catched the shutdown-event you have to use the function AbortSystemShutdown or just
delay your service-shutdown for example with the status SERVICE_STOP_PENDING.
GeneralRe: Delaying Shutdown through windows service and executing scripts ? Pin
Kushagra Tiwari22-Oct-09 3:48
Kushagra Tiwari22-Oct-09 3:48 
QuestionRe: Delaying Shutdown through windows service and executing scripts ? Pin
David Crow22-Oct-09 4:01
David Crow22-Oct-09 4:01 
AnswerRe: Delaying Shutdown through windows service and executing scripts ? Pin
Covean22-Oct-09 4:08
Covean22-Oct-09 4:08 
QuestionRe: Delaying Shutdown through windows service and executing scripts ? [modified] Pin
Kushagra Tiwari22-Oct-09 5:11
Kushagra Tiwari22-Oct-09 5:11 
AnswerRe: Delaying Shutdown through windows service and executing scripts ? [modified] Pin
Covean22-Oct-09 5:50
Covean22-Oct-09 5:50 
GeneralRe: Delaying Shutdown through windows service and executing scripts ? Pin
Kushagra Tiwari22-Oct-09 6:46
Kushagra Tiwari22-Oct-09 6:46 
QuestionRe: Delaying Shutdown through windows service and executing scripts ? Pin
Kushagra Tiwari22-Oct-09 21:10
Kushagra Tiwari22-Oct-09 21:10 
GeneralRe: Delaying Shutdown through windows service and executing scripts ? Pin
Kushagra Tiwari22-Oct-09 23:29
Kushagra Tiwari22-Oct-09 23:29 
GeneralRe: Delaying Shutdown through windows service and executing scripts ? Pin
Covean23-Oct-09 0:31
Covean23-Oct-09 0:31 
GeneralRe: Delaying Shutdown through windows service and executing scripts ? Pin
Kushagra Tiwari23-Oct-09 0:39
Kushagra Tiwari23-Oct-09 0:39 
QuestionRe: Delaying Shutdown through windows service and executing scripts ? Pin
Kushagra Tiwari23-Oct-09 2:12
Kushagra Tiwari23-Oct-09 2:12 
AnswerRe: Delaying Shutdown through windows service and executing scripts ? Pin
Covean23-Oct-09 2:40
Covean23-Oct-09 2:40 
GeneralRe: Delaying Shutdown through windows service and executing scripts ? Pin
Kushagra Tiwari23-Oct-09 3:01
Kushagra Tiwari23-Oct-09 3:01 
QuestionRe: Delaying Shutdown through windows service and executing scripts ? Pin
Kushagra Tiwari26-Oct-09 1:28
Kushagra Tiwari26-Oct-09 1:28 
AnswerRe: Delaying Shutdown through windows service and executing scripts ? Pin
Covean26-Oct-09 4:05
Covean26-Oct-09 4:05 
AnswerRe: Delaying Shutdown through windows service and executing scripts ? Pin
Kushagra Tiwari26-Oct-09 20:21
Kushagra Tiwari26-Oct-09 20:21 
QuestionSYBASE's Functions giving LOGIN CRASH problem in VC++ code Pin
Vetukuri Raju22-Oct-09 1:59
Vetukuri Raju22-Oct-09 1:59 

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.