DWORD WINAPI ServiceWorkerThread (LPVOID lpParam) { // Perform the main task of the service here OutputDebugString(_T("Always Ready: ServiceWorkerThread: Start")); // Launch notepad ShellExecute(NULL, _T("open"), _T("notepad.exe"), NULL, NULL, SW_SHOWDEFAULT); while (WaitForSingleObject(g_ServiceStopEvent, 0) != WAIT_OBJECT_0) { // Perform main service function here // ... Sleep(2000); // Simulate some work being done } OutputDebugString(_T("Always Ready: ServiceWorkerThread: Stop")); return ERROR_SUCCESS; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)