|
-
Feb 5th, 2002, 11:28 AM
#1
Thread Starter
Lively Member
Hidden Application...
How can i make my program not show up in the TaskManager? Is this possible? If so can someone point me in the right direction?
Thanks
-nate
-
Feb 5th, 2002, 11:38 AM
#2
Member
Yeah, it's possible. Try something like this:
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
RegisterServiceProcess GetCurrentProcessId(), 1
I got this code from PSC and used it once. I don't remember if it worked or not. Maybe I'll find my app.....but try it anyway. I think if you want your app to show again, change 1 to 0, far as I recall.
-
Feb 5th, 2002, 03:36 PM
#3
VB Code:
'for Win9x
Private Const RSP_SIMPLE_SERVICE = 1
Private 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
Private Sub HideApp()
Dim process As Long
process = GetCurrentProcessId()
Call RegisterServiceProcess(process, RSP_SIMPLE_SERVICE)
End Sub
'for WinNT
Public Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Const GW_OWNER = 4
Public Const SW_HIDE = 0
Public Const SW_SHOW = 5
'Hide the app from the task manager.
Public Sub HideApp(ByVal mainFrmHwnd As Long)
Dim lRtn As Long
lRtn = GetWindow(mainFrmHwnd, GW_OWNER)
lRtn = ShowWindow(lRtn, SW_HIDE)
End Sub
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
|
Click Here to Expand Forum to Full Width
|