Click here to Skip to main content
16,014,392 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: #define statements Pin
Mark Salsbery31-Jul-08 16:13
Mark Salsbery31-Jul-08 16:13 
GeneralRe: #define statements Pin
MarkB77731-Jul-08 16:24
MarkB77731-Jul-08 16:24 
GeneralRe: #define statements Pin
Mark Salsbery31-Jul-08 16:30
Mark Salsbery31-Jul-08 16:30 
GeneralRe: #define statements Pin
CPallini31-Jul-08 21:17
mveCPallini31-Jul-08 21:17 
AnswerRe: #define statements Pin
David Crow1-Aug-08 3:18
David Crow1-Aug-08 3:18 
GeneralRe: #define statements Pin
MarkB7771-Aug-08 3:21
MarkB7771-Aug-08 3:21 
QuestionHow to hook the system events, such as shutoff? Pin
kcynic31-Jul-08 14:00
kcynic31-Jul-08 14:00 
AnswerRe: How to hook the system events, such as shutoff? Pin
Mark Salsbery31-Jul-08 15:25
Mark Salsbery31-Jul-08 15:25 
This is a service application, right? If so...

Starting in Vista, you can register for the SERVICE_CONTROL_PRESHUTDOWN
notification and take time to finish the job.

See HandlerEx Callback Function[^]

For XP and below, here's what the docs say about the
SERVICE_CONTROL_SHUTDOWN event:

The SERVICE_CONTROL_SHUTDOWN control code should only be
processed by services that must absolutely clean up during
shutdown, because there is a limited time (about 20 seconds)
available for service shutdown. After this time expires,
system shutdown proceeds regardless of whether service shutdown
is complete. Note that if the system is left in the shutdown
state (not restarted or powered down), the service continues
to run.

If the service requires more time to clean up, it should
send STOP_PENDING status messages, along with a wait hint,
so the service controller knows how long to wait before
reporting to the system that service shutdown is complete.
However, to prevent a service from stopping shutdown, there
is a limit to how long the service controller waits. If the
service is being shut down through the Services snap-in, the
limit is 125 seconds. If the operating system is rebooting,
the time limit is specified in the WaitToKillServiceTimeout
value of the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control


Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: How to hook the system events, such as shutoff? Pin
kcynic31-Jul-08 15:40
kcynic31-Jul-08 15:40 
GeneralRe: How to hook the system events, such as shutoff? Pin
Mark Salsbery31-Jul-08 15:48
Mark Salsbery31-Jul-08 15:48 
GeneralRe: How to hook the system events, such as shutoff? Pin
kcynic31-Jul-08 15:59
kcynic31-Jul-08 15:59 
GeneralRe: How to hook the system events, such as shutoff? Pin
Mark Salsbery31-Jul-08 16:08
Mark Salsbery31-Jul-08 16:08 
GeneralRe: How to hook the system events, such as shutoff? Pin
kcynic31-Jul-08 16:12
kcynic31-Jul-08 16:12 
GeneralRe: How to hook the system events, such as shutoff? Pin
Mark Salsbery1-Aug-08 5:28
Mark Salsbery1-Aug-08 5:28 
GeneralRe: How to hook the system events, such as shutoff? Pin
Randor 31-Jul-08 16:14
professional Randor 31-Jul-08 16:14 
GeneralRe: How to hook the system events, such as shutoff? Pin
kcynic31-Jul-08 16:20
kcynic31-Jul-08 16:20 
GeneralRe: How to hook the system events, such as shutoff? Pin
Mark Salsbery31-Jul-08 16:24
Mark Salsbery31-Jul-08 16:24 
QuestionQuiz or Test program help needed.. Pin
the oso31-Jul-08 13:13
the oso31-Jul-08 13:13 
QuestionRe: Quiz or Test program help needed.. Pin
CPallini31-Jul-08 21:59
mveCPallini31-Jul-08 21:59 
AnswerRe: Quiz or Test program help needed.. Pin
David Crow1-Aug-08 3:15
David Crow1-Aug-08 3:15 
AnswerRe: Quiz or Test program help needed.. Pin
hoxsiew3-Aug-08 4:59
hoxsiew3-Aug-08 4:59 
QuestionClass Creation Problem Pin
Like2Byte31-Jul-08 12:46
Like2Byte31-Jul-08 12:46 
AnswerRe: Class Creation Problem Pin
Mark Salsbery31-Jul-08 13:13
Mark Salsbery31-Jul-08 13:13 
GeneralRe: Class Creation Problem Pin
Like2Byte31-Jul-08 14:18
Like2Byte31-Jul-08 14:18 
GeneralRe: Class Creation Problem Pin
Mark Salsbery31-Jul-08 14:51
Mark Salsbery31-Jul-08 14:51 

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.