VB中程序隐形

来源:百度知道 编辑:UC知道 时间:2024/07/08 12:10:50
我在网上找到了如下教程:

1. 在VB6.0编程环境中,新建一个工程Project1。

2. 在Project1中添加模块Modulel,在工程属性中将工程名称改为HiddenMen,应用程序标题也改为HiddenMen(以下程序都经过实际运行测试,可以原样复制使用)。

在模块Module1中加入如下声明:

Public Declare Function GetCurrentProcessId Lib “kernel32” () As
Long
’获得当前进程ID函数的声明
Public Declare Function RegisterServiceProcess Lib “kernel32” (ByVal ProcessId As
Long, ByVal ServiceFlags As Lo ng) As Long
’在系统中注册当前进程ID函数的声明

3. 在Project1中新建一个窗体Form1,设置Form1的属性:

form1.Visible=False
form1.ShowInTaskBar=False
在代码窗口添加如下代码:

Private Declare Function GetDriveType Lib “kernel32” Alias “GetDriveTypeA” (ByVal
nDrive As String) As Long
’获得当前驱动器类型函数的声明
Private Declare Function GetVolumeInformation Lib “kernel32” Alias
“GetVolumeInformationA” (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As
String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long,
lpMaximum

这个代码已经不适用~你另外找个。。
http://hi.baidu.com/gaoyuehong/blog/item/1a52a13d8e992606baa16785.html

不能用是因为你打微软的~补丁了。

只有windows 95/98/me 才支持 RegisterServiceProcess函数。
如果在windows nt/2000/xp/2003下,不能通过。