重啟鍵看不到的程式 (轉)

gugu99發表於2008-07-11
重啟鍵看不到的程式 (轉)[@more@]

重啟鍵看不到的

就是按Ctrl+Alt+DEl鍵在關閉程式中看不到該程式!

Private Sub Command1_Click()
'下面程式碼為隱藏
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub

Private Sub Command2_Click()
'恢復隱藏
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
End Sub

 

以下加入模組:

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

 


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10748419/viewspace-1007116/,如需轉載,請註明出處,否則將追究法律責任。

相關文章