API SendInput

11/07/2003 - 13:27 por NeoLeoX | Informe spam
Alguien tendra por ahi algun ejemplo en Fox de como usarla?

Leonel Ortega

Preguntas similare

Leer las respuestas

#1 Carlos Garcia Hermida
11/07/2003 - 13:48 | Informe spam
Aqui hay algo de ayuda aunque no sea en VFP.

http://msdn.microsoft.com/library/d...inui/winui
/windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboar
dinputfunctions/sendinput.asp
Respuesta Responder a este mensaje
#2 Mario Acevedo
11/07/2003 - 16:01 | Informe spam
NeoLeoX:
Este ejemplo es del API-Guide pero esta en VB

***
Const VK_H = 72
Const VK_E = 69
Const VK_L = 76
Const VK_O = 79
Const KEYEVENTF_KEYUP = &H2
Const INPUT_MOUSE = 0
Const INPUT_KEYBOARD = 1
Const INPUT_HARDWARE = 2
Private Type MOUSEINPUT
dx As Long
dy As Long
mouseData As Long
dwFlags As Long
time As Long
dwExtraInfo As Long
End Type
Private Type KEYBDINPUT
wVk As Integer
wScan As Integer
dwFlags As Long
time As Long
dwExtraInfo As Long
End Type
Private Type HARDWAREINPUT
uMsg As Long
wParamL As Integer
wParamH As Integer
End Type
Private Type GENERALINPUT
dwType As Long
xi(0 To 23) As Byte
End Type
Private Declare Function SendInput Lib "user32.dll" (ByVal nInputs As Long,
pInputs As GENERALINPUT, ByVal cbSize As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As
Any, pSrc As Any, ByVal ByteLen As Long)
Private Sub Form_KeyPress(KeyAscii As Integer)
'Print the key on the form
Me.Print Chr$(KeyAscii);
End Sub
Private Sub Form_Paint()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail:
'Clear the form
Me.Cls
'call the SendKey-function
SendKey VK_H
SendKey VK_E
SendKey VK_L
SendKey VK_L
SendKey VK_O
End Sub
Private Sub SendKey(bKey As Byte)
Dim GInput(0 To 1) As GENERALINPUT
Dim KInput As KEYBDINPUT
KInput.wVk = bKey 'the key we're going to press
KInput.dwFlags = 0 'press the key
'copy the structure into the input array's buffer.
GInput(0).dwType = INPUT_KEYBOARD ' keyboard input
CopyMemory GInput(0).xi(0), KInput, Len(KInput)
'do the same as above, but for releasing the key
KInput.wVk = bKey ' the key we're going to realease
KInput.dwFlags = KEYEVENTF_KEYUP ' release the key
GInput(1).dwType = INPUT_KEYBOARD ' keyboard input
CopyMemory GInput(1).xi(0), KInput, Len(KInput)
'send the input now
Call SendInput(2, GInput(0), Len(GInput(0)))
End Sub

***

Saludos;
Mario Acevedo
Montevideo-Uruguay
" NeoLeoX" escribió en el mensaje
news:
Alguien tendra por ahi algun ejemplo en Fox de como usarla?

Leonel Ortega


Respuesta Responder a este mensaje
#3 Pepe Llopis
11/07/2003 - 21:01 | Informe spam
¿Y utilizar KEYBOARD ??

Pepe Llopis
FUTURA Systems & software, S.L.
www.futuracenter.com


" NeoLeoX" escribió en el mensaje
news:
Alguien tendra por ahi algun ejemplo en Fox de como usarla?

Leonel Ortega


Respuesta Responder a este mensaje
#4 NeoLeoX
14/07/2003 - 08:49 | Informe spam
lo intente... pero no funciona una vez que el setForeground mueve el foco a
otra aplicacion.


"Pepe Llopis" wrote in message
news:
¿Y utilizar KEYBOARD ??

Pepe Llopis
FUTURA Systems & software, S.L.
www.futuracenter.com


" NeoLeoX" escribió en el mensaje
news:
> Alguien tendra por ahi algun ejemplo en Fox de como usarla?
>
> Leonel Ortega
>
>


email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida