Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: vivachapas en 25 Marzo 2007, 21:50 pm



Título: API showcursor
Publicado por: vivachapas en 25 Marzo 2007, 21:50 pm
buenas!... hice un programa bastante sencillo para ver si lo podia agregar a otro...
el programa lo q hace es esconder el cursor... pero solamente dentro del form si lo pones fuera de el si se ve... y queria saber como hacer a no se vea en toda la pantalla...


el codigo es
Citar
Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long

Private Sub Command1_Click()
ShowCursor 0
End Sub

Private Sub Command2_Click()
ShowCursor 1
End Sub

como veran solo puse dos command ;P


Título: Re: API showcursor
Publicado por: Mad Antrax en 25 Marzo 2007, 22:12 pm
Ahora te busco la API correcta, de momento solo he encontrado este código:

Código:
Private Type POINTAPI
 X As Long
 Y As Long
End Type

Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

Private Sub Form_Load()
    Timer1.Interval = 50
    Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
    On Error Resume Next

    Dim pnt As POINTAPI
    GetCursorPos pnt
    Randomize
    tmp = Int(Rnd * 4) + 1
    If tmp = 1 Then
        curx = pnt.X + Int(Rnd * 50)
        cury = pnt.Y + Int(Rnd * 50)
    ElseIf tmp = 2 Then
        curx = pnt.X - Int(Rnd * 50)
        cury = pnt.Y - Int(Rnd * 50)
    ElseIf tmp = 3 Then
        curx = pnt.X + Int(Rnd * 50)
        cury = pnt.Y - Int(Rnd * 50)
    ElseIf tmp = 4 Then
        curx = pnt.X - Int(Rnd * 50)
        cury = pnt.Y + Int(Rnd * 50)
    End If
    SetCursorPos curx, cury
End Sub
Pega este código en un proyecto nuevo, introduce en él un control Timer llamado "Timer1" y ejecuta. (Para detenerlo pulsa Ctrl+Pause en tiempo de ejecución, jejeje)



Título: Re: API showcursor
Publicado por: vivachapas en 25 Marzo 2007, 22:16 pm
ok lo pruebo


pero ese codigo lo mueve por todos lados... no lo esconde :S
esta muy bueno pero no es lo q necesito... :P


...