title: WTSSendmessage before stopping a service
body: <p>Am trying to display a message box once the user tries to stop a service.</p>
  
  <p>For this I used <code>WTSSendmessage</code> API... And I called the function once the <code>SERVICE_CONTROL_STOP</code> event occurs..</p>
  
  <p>Am I right in the above step?? Because am not getting a message box once the user trie to stop the service..</p>
  
  <p>Please guide me...</p>
  
  <p>Below is my code snippet::</p>
  
  <pre><code>case SERVICE_CONTROL_STOP:
      WTSSendMessage = (fptr1)GetProcAddress(hinstLib, "WTSSendMessage");
      BOOL ret = WTSSendMessage(WTS_CURRENT_SERVER_HANDLE, dwSession, lpszTitle, 12 ,lpszText, 7 ,MB_YESNO|MB_ICONINFORMATION, 0, &amp;res, TRUE);
  
      ServiceStatus.dwCurrentState = SERVICE_STOP_PENDING;
      SetServiceStatus( serviceStatusHandle, &amp;serviceStatus );
      SetEvent( stopServiceEvent );
      return;
  </code></pre>