网站标志
导航菜单
当前日期时间
当前时间:
购物车
购物车中有 0 件商品 去结算 我的订单
商品搜索
商品搜索:
文章正文
开机后只运行vb编写程序的办法
作者: 来源:中国机电工程网    发布于:2019-06-04 22:04:05    文字:【】【】【

用vb编写个监控程序,想一直运行,不允许退出,防止操作人员玩系统自带的游戏

1、程序中窗口属性borderstyle设为none,没有最小化和关闭按钮。退出程序需输入正确密码(软键盘)。

2、在注册表(regedit)“hkey_local_machine\software\microsoft\ s\currentversion\run”下新建一个字符串,其值设置为自动执行程序名,将它的数据设成程序所在目录,即可将该程序设置自动执行。

3、隐藏任务栏

'声明

public declare function set pos lib "user32" (byval hwnd as long, byval hwndinsertafter as long, byval x as long, byval y as long, byval cx as long, byval cy as long, byval wflags as long) as long

public declare function find lib "user32" alias "find a" (byval lpclassname as string, byval lp name as string) as long

public const swp_show = &h40

public const swp_hide = &h80

public const swp_noactivate = &h10

'程序开始禁止任务栏,退出时显示任务栏

hide = find ("shell_traywnd", vbnullstring)'禁止任务栏

call set pos(hide, 0, 0, 0, 0, 0, swp_hide )

hide = find ("shell_traywnd", vbnullstring)'显示任务栏

call set pos(hide, 0, 0, 0, 0, 0, swp_show )

以上只限于没有键盘的情况下,有键盘很难禁止其它程序运行。


浏览 (49) | 评论 (0) | 评分(0) | 支持(0) | 反对(0) | 发布人: 来源:中国机电工程网
将本文加入收藏夹
新闻详情
脚注栏目
|
脚注信息
机电工程网(C) 2015-2020 All Rights Reserved.    联系我们