title: How to run a program when a service crashes in Windows in C++?
body: <p>I would like to run another program when a service crashes. I know that I should use <code>SERVICE_FAILURE_ACTIONS</code> and <code>ChangeServiceConfig2()</code> provided by Microsoft. But, I got stuck using them because I can not find any example of using these structure and function.</p>
  <p>I would appreciate it if anyone can show me an example to implement this.</p>