怎样用VB做出用ALT+DEL+CTL关不掉的程序?

ebombsuhocom 2001-03-23 07:03:00
...全文
152 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
mingger 2001-06-02
  • 打赏
  • 举报
回复
在Win9x系列中
RegisterServiceProcess GetCurrentProcessId, 1
然后在Unload事件Cancel=true

在Win2k中就不行了,谁知道情欲我讨论(gakg@sohu.com)
bucher 2001-05-31
  • 打赏
  • 举报
回复
我记得有一个API可以使程序在任务列表中消失。好像是RegService。去www.webking.com.cn/vb 可以找到。
limengchen 2001-05-31
  • 打赏
  • 举报
回复
禁用Ctrl-Alt-Del
Private Declare Function EnableWindow Lib "user32" (ByVal hWnd As
Integer, ByVal aBOOL As Integer) As Integer
Private Declare Function IsWindowEnabled Lib "user32" (ByVal hWnd As
Integer) As Integer
Private Declare Function GetMenu Lib "user32" (ByVal hWnd As Integer) As
Integer
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (
ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SystemParametersInfo Lib "user32" Alias "
SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long,
ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
Private TaskBarhWnd As Long
Private IsTaskBarEnabled As Integer
Private TaskBarMenuHwnd As Integer
'禁止使用Ctrl-Alt-Del
Public Sub DisableTaskBar()
Dim EWindow As Integer
TaskBarhWnd = FindWindow("Shell_traywnd", "")
If TaskBarhWnd <> 0 Then
EWindow = IsWindowEnabled(TaskBarhWnd)
If EWindow = 1 Then
IsTaskBarEnabled = EnableWindow(TaskBarhWnd, 0)
End If
End If
End Sub
'允许使用Ctrl-Alt-Del
Public Sub EnableTaskBar()
If IsTaskBarEnabled = 0 Then
IsTaskBarEnabled = EnableWindow(TaskBarhWnd, 1)
End If
End Sub
'禁止 Ctrl+Alt+Del
' 声明(For Win95):
Const SPI_SCREENSAVERRUNNING = 97
Private Declare Function SystemParametersInfo Lib "user32" Alias "
SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long,
lpvParam As Any, ByVal fuWinIni As Long) As Long
使用:
'禁止
Dim pOld As Boolean
Call SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)
'开启
Dim pOld As Boolean
Call SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)



或者
Private Declare Function SystemParametersInfo Lib _
"user32" Alias "SystemParametersInfoA" (ByVal uAction _
As Long, ByVal uParam As Long, ByVal lpvParam As Any, _
ByVal fuWinIni As Long) As Long
自定义函数在Form_Load事件中调用即可
Sub DisableCtrlAltDelete(Flags As Boolean)
' Disables Control Alt Delete Breaking as well as Ctrl-Escape
Dim X As Long
X = SystemParametersInfo(97, Flags, CStr(1), 0)
End Sub
gameboy999 2001-05-31
  • 打赏
  • 举报
回复
registerservice!
skt642 2001-05-31
  • 打赏
  • 举报
回复
87072关注!
little_hero 2001-03-24
  • 打赏
  • 举报
回复
调用API!
bestofbest 2001-03-24
  • 打赏
  • 举报
回复
我还想知道有什么方法可以暴力关闭任何程序吗(假使我已经找到了它的句柄)?
正如有矛就有盾一样!我的妹儿是iscoffee@21cn.com
bestofbest 2001-03-24
  • 打赏
  • 举报
回复
那是个无效的答复嘛!
我希望有人可以告诉我怎么让我的程序无法被关闭.
好象万象幻景这样的程序就可以吧.我见过我的程序关不掉的程序.
我用的是sendmessage发了个WM_CLOSE.不知道是我的程序太差还是那个程序太厉害,
就这样死机了!是不是要设定一个超时的时间?
但是为什么可以让我的程序关不掉它呢?
我没有用ALT+CTRL+DEL试过(我没有仔细研究过,因为那程序限制了热键).
我说错了什么请大家尽管说,我是生手,请高手指点!谢谢!!!
heartbeat_hb 2001-03-23
  • 打赏
  • 举报
回复
隐藏进程!或在 FORM UNLOAD 中加入一句 x=shell(app.path & app.exename, 1)
dave75 2001-03-23
  • 打赏
  • 举报
回复
屏蔽系统热键
systemparametersinfo(97,true,1,0)即可.

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧