社区
进程/线程/DLL
帖子详情
请教枚举autostart、service的方法
w0ka0
2006-07-11 07:33:37
1。很多工具都是通过枚举注册表的x项来得到startup的,但还有没有别的方法吗?或者有朋友能贴段代码出来吗?
2。枚举service的代码,有没有GUI形式的呢?
...全文
242
3
打赏
收藏
请教枚举autostart、service的方法
1。很多工具都是通过枚举注册表的x项来得到startup的,但还有没有别的方法吗?或者有朋友能贴段代码出来吗? 2。枚举service的代码,有没有GUI形式的呢?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
hijack
2006-07-12
打赏
举报
回复
枚举服务:
#include <winsvc.h>
void testSv()
{
SC_HANDLE hSCManager = NULL;
hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
int nRet = 0;
if(hSCManager == NULL)
{
return ;
}
DWORD dwServicesReturned = 0;
DWORD cbBytesNeeded = 0;
DWORD cbBufSize = 0;
nRet = EnumServicesStatus(hSCManager,SERVICE_WIN32,SERVICE_STATE_ALL,NULL,0,&cbBytesNeeded,&dwServicesReturned,0);
ENUM_SERVICE_STATUS *lpServices = new ENUM_SERVICE_STATUS[cbBytesNeeded];
cbBufSize = cbBytesNeeded;
nRet = EnumServicesStatus(hSCManager,SERVICE_WIN32,SERVICE_STATE_ALL,lpServices,cbBufSize,&cbBytesNeeded,&dwServicesReturned,0);
if(nRet == 0)
{
return;
}
if(lpServices == 0)
{
CloseServiceHandle(hSCManager);
return;
}
for(DWORD i = 0; i < dwServicesReturned; i++, lpServices++)
{
cout << lpServices->lpDisplayName << endl;
}
CloseServiceHandle(hSCManager);
}
http://blog.csdn.net/trojanth/archive/2005/12/13/537518.aspx
DentistryDoctor
2006-07-12
打赏
举报
回复
注册表下的HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
及HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion
启动目录
w0ka0
2006-07-12
打赏
举报
回复
急需,顶一个。
Linux开机自启程序如何配置
方法
二(较安全)
写一个需要开机自启动并能退出重启某可执行程序的脚本
auto
s
tar
t.sh #!/bin/sh -e export LD_LIBRARY_PATH=xxx/lib:xxx/plugin:$LD_LIBRARY_PATH while true;do if test $(pgrep -f main|wc -l) -eq 0 then sudo ./main fi sleep 3 done 写一个能后台调用
auto
s
tar
t.sh的
auto
s
tar
t.local #!/bin/sh -e nohup.
ubuntu 18.04开机自启动实现
1、/etc/systemd/system/ 下新建文件,如
auto
s
tar
t.
service
,该文加写如下内容 [Unit] After = network.
tar
get [
Service
] ExecS
tar
t = /home/XXX/
auto
s
tar
t.sh [Install] WantedBy = default.
tar
get 2、新建脚本,如 /home/XXX/
auto
sta...
embed元素
auto
s
tar
t false 失效时的解决
方法
embed元素
auto
s
tar
t false 失效时的解决
方法
最近在工作中碰到了在网页中嵌入播放器播放声音文件的需求,最后使用了embed元素 代码如下: <embed src='1093.swf'
auto
s
tar
t='false' hidden='true' loop='false' ></embed> 在页面第一次加载时不让它发出声音,所以把au...
/etc/xdg/
auto
s
tar
t 和 ~/.config/
auto
s
tar
t的区别
/etc/xdg/
auto
s
tar
t 和 ~/.config/
auto
s
tar
t的区别
CentOS 启用或禁用服务自动启动 (Enable or Disable
Service
Auto
s
tar
t in CentOS)
在 CentOS 7 中检查服务自动启动是启用或禁用状态 [root@jasonsong ~]# systemctl is-enabled nginx 在 CentOS 7 中禁用服务自动启动 [root@jasonsong ~]# systemctl disable nginx 在 CentOS 7 中启用服务自动启动 [root@jasonsong ~]# systemctl ...
进程/线程/DLL
15,471
社区成员
49,182
社区内容
发帖
与我相关
我的任务
进程/线程/DLL
VC/MFC 进程/线程/DLL
复制链接
扫一扫
分享
社区描述
VC/MFC 进程/线程/DLL
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章