Visual Basic Foro
Programación => Visual Basic 6 => Mensaje iniciado por: antonio2005pe en Julio 19, 2015, 12:24:14 am
-
Hola amigos como estan, quisiera saber como puedo bloquear las combinaciones CTRL+ALT+SUPR, CTRL+SHIFT+ESC y el Taskmgr, porque tampoco puedo crear una clave en el regedit de Windows 8.1 a través de VB6?, no sale ningún mensaje de error pero no se registra nada.
Muchas Gracias.
-
Estimado antonio2005pe
Dale una revisada ha estos link
Enable or disable secure logon (Ctrl+Alt+Delete)
http://windows.microsoft.com/en-ca/windows/enable-disable-ctrl-alt-delete-logon#1TC=windows-7 (http://windows.microsoft.com/en-ca/windows/enable-disable-ctrl-alt-delete-logon#1TC=windows-7)
How to Add or Remove Task Manager from the CTRL+ALT+DEL Screen
http://www.sevenforums.com/tutorials/63006-ctrl-alt-del-screen-add-remove-task-manager.html (http://www.sevenforums.com/tutorials/63006-ctrl-alt-del-screen-add-remove-task-manager.html)
Saludos, desde algún lugar de Lima-Perú
-
Muchas gracias por tu respuesta, vi los links pero el primer link es para entrar a windows y el segundo es desactivar por medio de LGPE pero no hay otra forma de hacerlo a traves de VB6?, para incluirlo cuando inicie el programa se bloquea esa funcion pero cuando sale se vuelve a su estado normal, algun metodo como el SetWindowsHookEx
-
Hola amigos gusto en saludarte aver si te funciona esto para quitar el administrador de tareas (CTRL+ALT+SUPR)
Private Sub Command1_Click ()
Shell ("REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 1 /f")
End Sub
Private Sub Command2_Click()
Shell ("REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 0 /f ")
End Sub
-
Hola atonio2005pee
No recuerdo de donde lo saqué, pues lo tengo de hace un par de años (quizas más) pero en un salvapantallas que hice en una oportunidad usé esto para evitar la ejecución del TaskMrg:
En un Módulo bas:
Option Explicit
Private Type PROCESSENTRY32
dwSize As Long
cntUsage As Long
th32ProcessID As Long
th32DefaultHeapID As Long
th32ModuleID As Long
cntThreads As Long
th32ParentProcessID As Long
pcPriClassBase As Long
dwFlags As Long
szexeFile As String * 260
End Type
Private Const TH32CS_SNAPPROCESS As Long = 2&
Private AplicationtoKill As Boolean
Private uProcess As PROCESSENTRY32
Private ProcessFound As Long
Private TheProcess As Long
Private exitCode As Long
Private hSnapshot As Long
Private NameOfExecutable As String
Private charsit As Long
Private Const Programa As String = "taskmgr.exe"
Private Declare Function TerminateProcess Lib "kernel32" (ByVal ApphProcess As Long, ByVal uExitCode As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal blnheritHandle As Long, ByVal dwAppProcessId As Long) As Long
Private Declare Function ProcessFirst Lib "kernel32" Alias "Process32First" (ByVal hSnapshot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function ProcessNext Lib "kernel32" Alias "Process32Next" (ByVal hSnapshot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function CreateToolhelpSnapshot Lib "kernel32" Alias "CreateToolhelp32Snapshot" (ByVal lFlags As Long, lProcessID As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Public Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Public Sub TimerProc(ByVal lhwnd As Long, ByVal uMsg As Long, ByVal idEvent As Long, ByVal dwTime As Long)
On Error Resume Next
uProcess.dwSize = Len(uProcess)
hSnapshot = CreateToolhelpSnapshot(TH32CS_SNAPPROCESS, 0&)
ProcessFound = ProcessFirst(hSnapshot, uProcess)
'Buscar Procesos activos
Do While ProcessFound
charsit = InStr(1, uProcess.szexeFile, Chr$(0))
'Extraer Nombre del Proceso
NameOfExecutable = LCase$(Left$(uProcess.szexeFile, charsit - 1))
DoEvents
' Si proceso activo = taskmgr.exe ...
If Right$(NameOfExecutable, Len(Programa)) = LCase$(Programa) Then
TheProcess = OpenProcess(&H400 Or &H1, False, uProcess.th32ProcessID)
' Cerrar Proceso
AplicationtoKill = TerminateProcess(TheProcess, exitCode)
Call CloseHandle(TheProcess)
End If
ProcessFound = ProcessNext(hSnapshot, uProcess)
DoEvents
Loop
Call CloseHandle(hSnapshot)
End Sub
y desde tu App lo llamas así:
SetTimer Me.hwnd, 0, 150, AddressOf TimerProc
y lo detienes así:
KillTimer Me.hwnd, 0
si bien el ScreenSaver lo hice en WinXP aun me funciona el bloqueo del TaskMgr en Win8.1...
Espero haber ayudado...
Saludos Cordiales
me parece que tenía igualmente algo para interceptar las combinaciones CTRL+ALT+SUP y CTRL+SHIFT+ESC, veré si lo ubico por ahí...
-
Muchas gracias por sus respuestas, lo intentare y les dire como me fue
-
Hola amigos gusto en saludarte aver si te funciona esto para quitar el administrador de tareas (CTRL+ALT+SUPR)
Private Sub Command1_Click ()
Shell ("REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 1 /f")
End Sub
Private Sub Command2_Click()
Shell ("REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 0 /f ")
End Sub
Me funciono de maravillas, muchas gracias.
-
Hola atonio2005pee
No recuerdo de donde lo saqué, pues lo tengo de hace un par de años (quizas más) pero en un salvapantallas que hice en una oportunidad usé esto para evitar la ejecución del TaskMrg:
En un Módulo bas:
Option Explicit
Private Type PROCESSENTRY32
dwSize As Long
cntUsage As Long
th32ProcessID As Long
th32DefaultHeapID As Long
th32ModuleID As Long
cntThreads As Long
th32ParentProcessID As Long
pcPriClassBase As Long
dwFlags As Long
szexeFile As String * 260
End Type
Private Const TH32CS_SNAPPROCESS As Long = 2&
Private AplicationtoKill As Boolean
Private uProcess As PROCESSENTRY32
Private ProcessFound As Long
Private TheProcess As Long
Private exitCode As Long
Private hSnapshot As Long
Private NameOfExecutable As String
Private charsit As Long
Private Const Programa As String = "taskmgr.exe"
Private Declare Function TerminateProcess Lib "kernel32" (ByVal ApphProcess As Long, ByVal uExitCode As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal blnheritHandle As Long, ByVal dwAppProcessId As Long) As Long
Private Declare Function ProcessFirst Lib "kernel32" Alias "Process32First" (ByVal hSnapshot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function ProcessNext Lib "kernel32" Alias "Process32Next" (ByVal hSnapshot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function CreateToolhelpSnapshot Lib "kernel32" Alias "CreateToolhelp32Snapshot" (ByVal lFlags As Long, lProcessID As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Public Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Public Sub TimerProc(ByVal lhwnd As Long, ByVal uMsg As Long, ByVal idEvent As Long, ByVal dwTime As Long)
On Error Resume Next
uProcess.dwSize = Len(uProcess)
hSnapshot = CreateToolhelpSnapshot(TH32CS_SNAPPROCESS, 0&)
ProcessFound = ProcessFirst(hSnapshot, uProcess)
'Buscar Procesos activos
Do While ProcessFound
charsit = InStr(1, uProcess.szexeFile, Chr$(0))
'Extraer Nombre del Proceso
NameOfExecutable = LCase$(Left$(uProcess.szexeFile, charsit - 1))
DoEvents
' Si proceso activo = taskmgr.exe ...
If Right$(NameOfExecutable, Len(Programa)) = LCase$(Programa) Then
TheProcess = OpenProcess(&H400 Or &H1, False, uProcess.th32ProcessID)
' Cerrar Proceso
AplicationtoKill = TerminateProcess(TheProcess, exitCode)
Call CloseHandle(TheProcess)
End If
ProcessFound = ProcessNext(hSnapshot, uProcess)
DoEvents
Loop
Call CloseHandle(hSnapshot)
End Sub
y desde tu App lo llamas así:
SetTimer Me.hwnd, 0, 150, AddressOf TimerProc
y lo detienes así:
KillTimer Me.hwnd, 0
si bien el ScreenSaver lo hice en WinXP aun me funciona el bloqueo del TaskMgr en Win8.1...
Espero haber ayudado...
Saludos Cordiales
me parece que tenía igualmente algo para interceptar las combinaciones CTRL+ALT+SUP y CTRL+SHIFT+ESC, veré si lo ubico por ahí...
Probe tu codigo, ese codigo es para matar el taskmgr hasta que el programa se cierre, tambien me funciona muy bien, muchas gracias