Dzwebs.Net

撰写电脑技术杂文十余年

如何隐藏任务管理器中的VB程序进程

Admin | 2009-5-5 13:21:41 | 被阅次数 | 311063

温馨提示!

如果未能解决您的问题,请点击搜索;登陆可复制文章,点击登陆

  实现功能:将您的程序从Windows的任务管理器进程列表中隐藏(即CTRL+ALT+DEL出来的框)

  ①复制以下代码到一模块中

  Declarations
  Public Declare Function GetCurrentProcessId Lib "kernel32" () As Long
  Public Declare Function GetCurrentProcess 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()
  regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
  End Sub

  ③恢复隐藏代码

  Public UnMakeMeService()
  Dim pid As Long
  Dim reserv As Long
  pid = GetCurrentProcessId()
  regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
  End Sub


该杂文来自: 网站开发杂文

上一篇:VB实现客户机←→服务器(TCP/IP)编程监听代码

下一篇:使用dropdownlist的SelectedIndexChanged事件实现

网站备案号:

网站备案号:滇ICP备11001339号-7

版权属性:

Copyright 2007-2021-forever Inc. all Rights Reserved.

联系方式:

Email:dzwebs@126.com QQ:83539231 访问统计