http://blog.csdn.net/jpexe/article/details/4296955
- // ---------------------------------------------------------------------------
- // 设置服务的描述
- void TService1::SetDescription(WideString Desc)
- {
- SC_HANDLE hSCM;
- SC_HANDLE hService;
- SERVICE_DESCRIPTION sd;
- hSCM = OpenSCManager(
- NULL,
- NULL,
- SC_MANAGER_ALL_ACCESS);
- if (hSCM == 0)
- {
- return;
- }
- hService = OpenService(
- hSCM,
- this->DisplayName.c_str(),
- SERVICE_CHANGE_CONFIG);
- if (hService == 0)
- {
- return;
- }
- sd.lpDescription = Desc.c_bstr();
- ChangeServiceConfig2(
- hService,
- SERVICE_CONFIG_DESCRIPTION,
- & sd);
- CloseServiceHandle(hService);
- CloseServiceHandle(hSCM);
- }
- //---------------------------------------------------------------------------
- void __fastcall TService1::ServiceAfterInstall(TService *Sender)
- {
- // 安装结束以后, 设置服务的描述
- this->SetDescription
- (L" 我的描述 描述 喵");
- }
- //---------------------------------------------------------------------------
http://blog.csdn.net/warrially/article/details/8513985
原文链接: https://www.cnblogs.com/findumars/p/6359750.html
欢迎关注
微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍
原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/248625
非原创文章文中已经注明原地址,如有侵权,联系删除
关注公众号【高性能架构探索】,第一时间获取最新文章
转载文章受原作者版权保护。转载请注明原作者出处!