教程中国
PHOTOSHOP CS9.0中文版 MAYA 8.5 FOR WINDOWS Corel Painter v9.0 Flash MX2004 中文版 Illustrator cs2 中文版
VC++6.0含sp6 中英文版 VB6.0 +sp6 简体中文版 Borland Delphi 7汉化版 MSDN for vb6.0中文版 Visual Studio 2005简体
教程中国下属 文件存储共享专家BIBIDU.COM 提供大型软件,教材,源码,电影,音乐,图书等下载 更多精品请点此进入
  您目前所在位置: 教程中国 >> 编程基地 >> VB >> 从任务列表中隐藏 按Ctrl+Alt+Del时也不会显示出来 RSS订阅
从任务列表中隐藏 按Ctrl+Alt+Del时也不会显示出来
教程(视频,书籍)下载:  ASP.NET AutoCAD 数据库 C# ASP java photoshop 网页设计 delphi 3dmax Flash C++ VB 张孝祥 实例   更多请进入BIBIDU搜索
IT搜索引擎   
程序说明:

  这个程序比较简单,只使用了GetCurrentProcessId 和 RegisterServiceProcess 两个函数就可以达到。

  这种方法只能在 Windows98 中运行,在 Windows2000中是不行的

  程序代码:

Module1

Public Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Public Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
Public Const RSP_SIMPLE_SERVICE = 1
Public Const RSP_UNREGISTER_SERVICE = 0

下面代码为隐藏

Public Sub MakeMeService()
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId() 注释:取的当前运行的程序Id

regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
对当前的程序传入 RSP_SIMPLE_SERVICE 消息,使此程序
从任务列表中隐藏
End Sub

注释:恢复隐藏
Public Sub UnMakeMeService()
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
原理同上
End Sub

Private Sub Command1_Click()
Call MakeMeService
End Sub

Private Sub Command2_Click()
Call UnMakeMeService
End Sub

Private Sub Form_Load()
Form1.Left = Screen.Width / 2 - Form1.Width / 2
Form1.Top = Screen.Height / 2 - Form1.Height / 2
End Sub

来源:upschool.cn
作者:
关键字:从任务列表中隐藏
发表日期:2006-12-20 21:18:36

网页显示有限 阅读全文请下载本文完整版WORD文档

上一篇:如何在VB中判断Windows9x的运行模式   下一篇:在Visual Basic中终止Windows 9X


2009-1-10 9:35:13
本文的相类似文章
  • 从任务列表中隐藏 按Ctrl+Alt+Del时也不会显示出来
  • 从任务列表中隐藏 按Ctrl+Alt+Del时也不会显示出来
  • 在学习中进步 在进步中成长 教程中国相随您的成长之路
    华腾联合科技股份有限公司版权所有
    广告联系:Rosibo@163.com