-
my project starts with sub main of a bas module.
in this sub some initialization of variables takes place
after that load form takes place (but form is not shows)
in this form there is a timer ctrl and a text box.
the timer interval is set to 30000 ms.
in the timer event the content of text box is written to a disk file in some folder.
i want to hide my app. from windows tasklist
these are i tried but failed
1.)App.TaskVisible = False
2.) form1.ShowInTaskbar = False (compiler error)
compile error:
Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic
3.)ShowWindow Me.hWnd, SW_HIDE
SetWindowPos Me.hWnd, -1, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_NOMOVE Or WP_NOSIZE
plz, help me
-
Code:
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()
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
-
Thanx, Thanx
Thanx very much Vlatko.
for last weeks and vasting my time to find a solution for this.
But i am experience a strange bug in my project.
Yes when i try alt + ctrl + del was pressed after that my program doesn't work properly.
in form load event i hooked my form (sub classing) in order to trap the key events.
can u help me ?