1、可以使用PostMessage实现消息的广播
2、创建服务的时候,需要修改CreateService的参数,添加SERVICE_INTERACTIVE_PROCESS,具体如下:
C/C++ code?
SC_HANDLE hService = ::CreateService(
hSCM, m_szServiceName, m_szServiceName,
SERVICE_ALL_ACCESS,
SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL,
szFilePath, NULL, NULL, _T("RPCSS\0"), NULL, NULL);