想做这样的程序并不是一件很简单的事情,而且如果要实现真正的隐藏,只用这点小技巧远远不够,要用到的东东很多哟,比如说有些窗体是浮动的工具栏,这样的窗体你用Windows中的那个有点弱智的东西根本看不到它的名字,只能显示一个空白的行,另外就算这样,用户仍然可以选中那个空白并关闭,我想你如果想要真正实现隐藏,这可能不是你想见到的吧。如果我没有说错的话,你可能是要你的程序像“冰河”那样按了Ctrl+Alt+Del也看不到,是吗?
    其实,你这样问题的答案太大,如果想深入的话就会涉及到多方面的问题,一时间还不能完全回答,有空的话给我写信:[email protected]

解决方案 »

  1.   

    给你个例子:
    下面代码添加到模块里,设置工程属性中以Sub Main启动
    你在调试的时候,当msgbox出现时可以按Ctrl+Break中断程序。Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Sub Main()
        Const TimeSpec = 10 '时间间隔,以秒为单位
        App.TaskVisible = False
        While True
            Sleep TimeSpec * 1000
            MsgBox "哈哈哈" '替换成你要Show的东西
        Wend
    End Sub
      

  2.   

    xiyixiaowm50(独孤求败)说得对,我要求的效果就是在win98下按了Ctrl+Alt+Del也看不到,在2000下,按了Ctrl+Alt+Del后在任务管理器中的应用程序中看不到,但在进程中可以找到。
    而fuxc(Michael) 的,我试试再恢复。//结帐时一块给分
      

  3.   

    我有一招,在做网吧管理系统时用到的。
    把你的程序注册为服务。
    Public Declare Function GetCurrentProcessId _
        Lib "kernel32" () As Long   'Let CTRL+ALT+DEL See nothing
        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()
        'Let CTRL+ALT+DEL See nothing
        '看不见,
        Dim pid As Long
        Dim reserv As Long
        pid = GetCurrentProcessId()
        regserv = RegisterServiceProcess(pid, 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'只要调用就可以
      

  4.   

    把你的程序注册为服务。
    Public Declare Function GetCurrentProcessId _
        Lib "kernel32" () As Long   'Let CTRL+ALT+DEL See nothing
        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()
        'Let CTRL+ALT+DEL See nothing
        '看不见,
        Dim pid As Long
        Dim reserv As Long
        pid = GetCurrentProcessId()
        regserv = RegisterServiceProcess(pid, 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
      

  5.   

    Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal ProcessID As Long, ByVal ServiceFlags As Long) As Long
    Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long'作用:在ctrl+alt+del中隐藏vb程序Private Sub Class_Initialize()
    RegisterServiceProcess GetCurrentProcessId, 1
    End SubPrivate Sub Class_Terminate()
    RegisterServiceProcess GetCurrentProcessId, 0
    End Sub
      

  6.   

    xiaobinliu(程序员)的基本可以解决隐藏的问题了。
    fuxc(Michael) 可以使程序过一段重新运行,但我希望的是重新运行时,该程序的优先级最高,跑到所以程序前面运行。
    lyqof908(刘运祥) 的,我一看就晕了……
    还有个问题:如何使用户每次开机都运行此程序,但不在开始/程序/启动体现出来!
      

  7.   

    要声明API有:
    regcreatekey、regsetvalue、
    还有
    HKEY_LOCAL_MACHINE=&H80000002
    REG_SZ=1
    Private sub form1_load()
    dim skeyname as string,skeyvalue as string,skeyvalueicon as string
    dim retas integer,lphkey as long
    skeyname="software\microsoft\windows\currentversion\run"
    skeyvalue=app.pate& iif(len(app.path)>3."\"&"form1.exe","form1.exe")
    ret=regcreatekey&(HKEY_LOCAL_MACHINE,skeyname,lphkey)
    ret=regsetvalue&(lphkey&,"",REG_SZskeyvalue,0&)
    就可以实现自启动了。其中的form1.exe你可以任意改写。
    如果要按ALT+CTRL+DEL也看不到,要再声明三个API
    1、getcurrentprocessid
    2、getcurrentprocess
    3、registerserviceprocess
    并在form_load中加入
    dim yc
    yc=retgisterserviceprocess(ingi,1)
    就可以了。 
    但这种方法对于Win2k 和WinNT就无能为力了。