|
152
|
Seguridad Informática / Hacking / Re: Hackear semaforos
|
en: 1 Febrero 2010, 20:02 pm
|
eso si es interesante al menos pero esto no lo veo salida
diran lo que quieran, que sera un tema chorra pero mira que pila respuestas :/
no lo veo salida la verdad jeje, solo como practica en casa
|
|
|
154
|
Programación / Programación Visual Basic / Re: Detectar atajos de teclado
|
en: 1 Febrero 2010, 16:49 pm
|
esto en el form load: If RegisterHotKey(hWnd, 1, MOD_CONTROL Or MOD_ALT, VK_1) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If If RegisterHotKey(hWnd, 2, MOD_CONTROL Or MOD_ALT, VK_2) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If If RegisterHotKey(hWnd, 3, MOD_CONTROL Or MOD_ALT, VK_3) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If If RegisterHotKey(hWnd, 4, MOD_CONTROL Or MOD_ALT, VK_4) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If If RegisterHotKey(hWnd, 5, MOD_CONTROL Or MOD_ALT, VK_5) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If If RegisterHotKey(hWnd, 6, MOD_CONTROL Or MOD_ALT, VK_6) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If If RegisterHotKey(hWnd, 7, MOD_CONTROL Or MOD_ALT, VK_7) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If If RegisterHotKey(hWnd, 8, MOD_CONTROL Or MOD_ALT, VK_8) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If WinProc = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf NewWindowProc)
esto en el modulo: Public Function NewWindowProc( _ ByVal hWnd As Long, _ ByVal Msg As Long, _ ByVal wParam As Long, _ ByVal lParam As Long) As Long If Msg = &H82 Then Call SetWindowLong(hWnd, GWL_WNDPROC, WinProc) Call UnregisterHotKey(hWnd, 1) End If if wparam = 1 then msgbox "apretaste 1" if wparam = 2 then msgbox "apretaste 2" if wparam = 3 then msgbox "apretaste 3" if wparam = 4 then msgbox "apretaste 4" if wparam = 5 then msgbox "apretaste 5" if wparam = 6 then msgbox "apretaste 6" if wparam = 7 then msgbox "apretaste 7" if wparam = 8 then msgbox "apretaste 8" NewWindowProc = CallWindowProc(WinProc, hWnd, Msg, wParam, lParam) End Function
|
|
|
159
|
Programación / Programación Visual Basic / Re: Detectar atajos de teclado
|
en: 31 Enero 2010, 13:01 pm
|
ok muchas gracias mira tengo otra duda, el proceso para ello es el sigueinte If RegisterHotKey(hWnd, 1, MOD_CONTROL Or MOD_ALT, VK_1) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If If RegisterHotKey(hWnd, 1, MOD_CONTROL Or MOD_ALT, VK_2) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If If RegisterHotKey(hWnd, 1, MOD_CONTROL Or MOD_ALT, VK_3) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If If RegisterHotKey(hWnd, 1, MOD_CONTROL Or MOD_ALT, VK_4) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If If RegisterHotKey(hWnd, 1, MOD_CONTROL Or MOD_ALT, VK_5) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If If RegisterHotKey(hWnd, 1, MOD_CONTROL Or MOD_ALT, VK_6) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If If RegisterHotKey(hWnd, 1, MOD_CONTROL Or MOD_ALT, VK_7) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If If RegisterHotKey(hWnd, 1, MOD_CONTROL Or MOD_ALT, VK_8) = 0 Then MsgBox " Hubo un error ", vbCritical Exit Sub End If WinProc = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf NewWindowProc)
y en el modulo es asi: Public Function NewWindowProc( _ ByVal hWnd As Long, _ ByVal Msg As Long, _ ByVal wParam As Long, _ ByVal lParam As Long) As Long If Msg = &H82 Then Call SetWindowLong(hWnd, GWL_WNDPROC, WinProc) Call UnregisterHotKey(hWnd, 1) End If If Msg = WM_HOTKEY Then MsgBox "atajos dados" End If NewWindowProc = CallWindowProc(WinProc, hWnd, Msg, wParam, lParam) End Function
como hago para identificar si se ha dado a ctrl + alt + 2 en vez de a ctrl + alt + 7 por ejemplo? ya que para identificarlo usan la constante msg y devuelve unicamente el valor de que se ha ejecutado la pulsacion de teclas, una cualquiera saludos
|
|
|
|
|
|
|