Bonjour,
J'intercepte le flux clavier avec un Hook et je bloque la touche "." du pavé numérique.
Mon problème c'est que j'aimerai remplacer cette touche par un "," ... mais lorsque je fait un sendkey ou keybd_event, mon hook intercepte le "," et me le recrache aprés celui que j'envoi "à la main" => Résultat je me retrouve avec ",,"
J'ai tout essayé mais j'y arrive tout simplement paaaaaaaaaassssss =>
****************************************************************
Public Function IsHooked(ByRef Hookstruct As KBDLLHOOKSTRUCT) As Integer
If (Hookstruct.vkCode = VK_DECIMAL) Then
Return Hookstruct.vkCode
End If
Return 0
End Function
****************************************************************
Public Function KeyboardCallback(ByVal Code As Integer, _
ByVal wParam As Integer, _
ByRef lParam As KBDLLHOOKSTRUCT) As Integer
If (Code = HC_ACTION) Then
If IsHooked(lParam) <> 0 Then
Return 1
End If
End If
Return CallNextHookEx(KeyboardHandle, Code, wParam, lParam)
End Function
****************************************************************
Public Delegate Function KeyboardHookDelegate( _
ByVal Code As Integer, _
ByVal wParam As Integer, _
ByRef lParam As KBDLLHOOKSTRUCT) As Integer
****************************************************************
<MarshalAs(UnmanagedType.FunctionPtr)> Private callback As KeyboardHookDelegate
****************************************************************
'Je lance donc la fonction qui suis =>
Public Sub HookKeyboard()
callback = New KeyboardHookDelegate(AddressOf KeyboardCallback)
KeyboardHandle = SetWindowsHookEx( _
WH_KEYBOARD_LL, callback, _
Marshal.GetHINSTANCE( _
[Assembly].GetExecutingAssembly.GetModules()(0)).ToInt32, 0)
End Sub
****************************************************************
Quelqu'un aurai t'il une idée du "comment faire" ?
Merci!