Implementar API

13/02/2005 - 16:45 por Julio G. | Informe spam
Como podria la siguiente API en VFP8 ?

Public Declare Function SetWindowsHookEx Lib "user32" _
Alias "SetWindowsHookExA" (ByVal idHook As Integer, _
ByVal lpfn As KeyboardHookDelegate, ByVal hmod As
Integer, _
ByVal dwThreadId As Integer) As Integer

..Esto con el fin de bloquear la tecla Tab a bajo nivel.

Muchas Gracias
Julio Guevara

Preguntas similare

Leer las respuestas

#1 Marlos E. Gomez
14/02/2005 - 14:52 | Informe spam
Hola que tal

VB:
Public Declare Function SetWindowsHookEx Lib "user32" _
Alias "SetWindowsHookExA" (ByVal idHook As Integer, _
ByVal lpfn As KeyboardHookDelegate, ByVal hmod As
Integer, ByVal dwThreadId As Integer) As Integer

VFP:
Declare Integer SetWindowsHookEx In "user32" Alias "SetWindowsHookExA"
idHook As Integer, ;
lpfn As Integer, hmod As Integer, dwThreadId As Integer

_________________
Saludos
Marlos E. Gomez
Caracas - Venezuela
Respuesta Responder a este mensaje
#2 Julio G.
16/02/2005 - 17:52 | Informe spam
Gracias, pero queria ver que era cada parametro
¿Tienes algun ejemplo en VFP?

Un Saludo
Julio Guevara

Hola que tal

VB:
Public Declare Function SetWindowsHookEx Lib "user32" _
Alias "SetWindowsHookExA" (ByVal idHook As Integer, _
ByVal lpfn As KeyboardHookDelegate, ByVal hmod As
Integer, ByVal dwThreadId As Integer) As Integer

VFP:
Declare Integer SetWindowsHookEx In "user32"


Alias "SetWindowsHookExA"
idHook As Integer, ;
lpfn As Integer, hmod As Integer, dwThreadId As Integer

_________________
Saludos
Marlos E. Gomez
Caracas - Venezuela


.

Respuesta Responder a este mensaje
#3 Pablo Roca
24/02/2005 - 13:30 | Informe spam
Hola,

Lo mejor para inverstigar en la API es que te bajes el API Guide:

http://www.mentalis.org/agnet/apiguide.shtml

Y tambien el ApiViewer 2004 en:

http://www.activevb.de/rubriken/api...ereng.html

Los parametros son:

http://msdn.microsoft.com/library/d...hookex.asp

Ejemplo en VB que debes convertir a VFP

'In a module
Public Const WH_KEYBOARD = 2
Public Const VK_SHIFT = &H10
Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal
ncode As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As
Integer
Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA"
(ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal
dwThreadId As Long) As Long
Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As
Long
Public hHook As Long
Public Function KeyboardProc(ByVal idHook As Long, ByVal wParam As Long,
ByVal lParam As Long) As Long
'if idHook is less than zero, no further processing is required
If idHook < 0 Then
'call the next hook
KeyboardProc = CallNextHookEx(hHook, idHook, wParam, ByVal lParam)
Else
'check if SHIFT-S is pressed
If (GetKeyState(VK_SHIFT) And &HF0000000) And wParam = Asc("S") Then
'show the result
Form1.Print "Shift-S pressed ..."
End If
'call the next hook
KeyboardProc = CallNextHookEx(hHook, idHook, wParam, ByVal lParam)
End If
End Function

'In a form, called Form1
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail:
'set a keyboard hook
hHook = SetWindowsHookEx(WH_KEYBOARD, AddressOf KeyboardProc,
App.hInstance, App.ThreadID)
End Sub
Private Sub Form_Unload(Cancel As Integer)
'remove the windows-hook
UnhookWindowsHookEx hHook
End Sub


Saludos,

Pablo Roca - Microsoft Visual Foxpro MVP
Sysop de PortalFox (http://www.portalfox.com)
La Coruña, España
"Apoya a FoxPro, utiliza software legal"


"Julio G." escribió en el mensaje
news:108301c51447$e6c57160$
Gracias, pero queria ver que era cada parametro
¿Tienes algun ejemplo en VFP?

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