Pregunta: | 22144 - OCULTAR MI PROGRAMA DE LA VENTANA DE PROGRAMAS EN EJECUCIóN |
Autor: | Alvaro Vega |
Hola colegas.
Mi deseo es hacer una aplicacion en visual Basic la cual no sea visible en la lista de procesos que aparecen al momento de presionar (Ctrl + Alt + Supr) como puedo hacer esto que no pueda ser vista en la ventana de procesos. Agradezco su respuesta |
Respuesta: | Oswaldo Monagas |
Aqui tienes el codigo completo. Espero que te sirva, ya he trabajado con el y funciona perfecto.
How To hide your program from the Ctrl+Alt+Delete list The Application Programming Interface makes it easy to hide your program from the task list. Simply use the handly code below to register your application as a service, thus rendering the program invisible to the user. Here's How: 1. Start up Visual Basic and add a form to the project. 2. Copy this code into the declarations section of the form: Private Declare Function GetCurrentProcessId _ Lib "kernel32" () As Long Private Declare Function GetCurrentProcess _ Lib "kernel32" () As Long Private Declare Function RegisterServiceProcess _ Lib "kernel32" (ByVal dwProcessID As Long, _ ByVal dwType As Long) As Long Private Const RSP_SIMPLE_SERVICE = 1 Private Const RSP_UNREGISTER_SERVICE = 0 3. Create a new procedure to the form, called "MakeMeService". (function MakeMeService()) 4. Add the following code to this procedure: Dim pid As Long Dim regserv As Long pid = GetCurrentProcessId() regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE) 5. To remove your program from the Ctrl+Alt+Delete add this code to call the procedure: Call MakeMeService 6. Create a new procedure to the form, called "UnMakeMeService". (function UnMakeMeService()) 7. Add the following code to this procedure: Dim pid As Long Dim regserv As Long pid = GetCurrentProcessId() regserv = RegisterServiceProcess(pid, _ RSP_UNREGISTER_SERVICE) 8. To unregister your application as a service (and therefore how the program in the Ctrl+Alt+Delete task list) add this code to call the procedure: Call UnMakeMeService ( in Terminate or …) Massimo Branca aka calfinator. |