-
The invisible program
For my keylogger which is going to be my major assignment for school, i have
noticed one problem. So far, i can hide the program from the taskbar, but
not from task manager, therefore anyone with a slight knowledge of computing
can easily close down my program and continue as normal. You see, i can't
have that, i need my program to run silently in the background without the
user being able to close or crash my program through task manager. This
needs to be done on a windows 98 machine as i'm making this program for 98
only.
If anyone knows how to hide the program from task manager, please tell me.
Any help would be appreciated
James Abbott
-
Re: The invisible program
> If anyone knows how to hide the program from task manager, please tell me.
> Any help would be appreciated
From www.allapi.net (APIGUIDE):
Const RSP_SIMPLE_SERVICE = 1
Const RSP_UNREGISTER_SERVICE = 0
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long,
ByVal dwType As Long) As Long
Public Sub MakeMeService()
Dim pid As Long, reserv As Long
'Get the current process ID
pid = GetCurrentProcessId()
'Register as service
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub
Public Sub UnMakeMeService()
Dim pid As Long, reserv As Long
'Get the current process ID
pid = GetCurrentProcessId()
'Unregister as service
regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
End Sub
Private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
MakeMeService
'Right now, you're program is hidden from the CTRL-ALT-DEL-list
End Sub
Private Sub Form_Unload(Cancel As Integer)
UnMakeMeService
End Sub
Another possibility is not to hide the app, but to restart:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If Unloadmode = 3 Then 'Taskmanager wants to kill the app
Call Shell(App.Path & "\" & App.Exename & ".exe", 0)
End If
End Sub
Juergen.
-
Re: The invisible program
> If anyone knows how to hide the program from task manager, please tell me.
> Any help would be appreciated
From www.allapi.net (APIGUIDE):
Const RSP_SIMPLE_SERVICE = 1
Const RSP_UNREGISTER_SERVICE = 0
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long,
ByVal dwType As Long) As Long
Public Sub MakeMeService()
Dim pid As Long, reserv As Long
'Get the current process ID
pid = GetCurrentProcessId()
'Register as service
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub
Public Sub UnMakeMeService()
Dim pid As Long, reserv As Long
'Get the current process ID
pid = GetCurrentProcessId()
'Unregister as service
regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
End Sub
Private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
MakeMeService
'Right now, you're program is hidden from the CTRL-ALT-DEL-list
End Sub
Private Sub Form_Unload(Cancel As Integer)
UnMakeMeService
End Sub
Another possibility is not to hide the app, but to restart:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If Unloadmode = 3 Then 'Taskmanager wants to kill the app
Call Shell(App.Path & "\" & App.Exename & ".exe", 0)
End If
End Sub
Juergen.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks