| |
|
|
|
Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) in The Babyklappe on XProfan.Com stored:
Tastatureingaben intercepting (Umlaute in normal letters umsetzen)
in the subesquent example becomes the Umsetzen of Umlauten in normalen letters undertaken.
it becomes a Nachrichtenfilterfunktion for The keyboard-Messages through SetWindowsHookEx installs.
tappt im dunkeln heading The thorough keyboard-Messages on The CallBack-routine KbdHookProc circa and evaluates tappt im dunkeln from,
before tappt im dunkeln abgefangen (with Return <> 0) or weitergeleitet (with Return = 0) be.
it go The virtual Key-Codes for The german Umlaute abgefangen and with Keybd_Event in one
entsprechendes Äquivalent umgesetzt.
it go two MultiEdit-Controls on the Window opened, circa To show, that these routine independent
of whom Controls work.
on the end is it necessary, The verkettete routine through UnHookWindwsEx on the end again To . Remove
-Begin-----------------------------------------------------------------
$H windows.ph
-DeclareVariables----------------------------------------------------
Declare hKbdHook&, Ende&
-HookProc------------------------------------------------------------
Proc KbdHookProc
Parameters nCode&, wParam&, lParam&
Declare RetCode&
If wParam& = 222 Ä
If lParam& < 0
~keybd_event(65, 0, 0, 0)
~keybd_event(65, 0, ~KEYEVENTF_KEYUP, 0)
~keybd_event(69, 0, 0, 0)
~keybd_event(69, 0, ~KEYEVENTF_KEYUP, 0)
EndIf
RetCode& = 1
ElseIf wParam& = 192 Ö
If lParam& < 0
~keybd_event(79, 0, 0, 0)
~keybd_event(79, 0, ~KEYEVENTF_KEYUP, 0)
~keybd_event(69, 0, 0, 0)
~keybd_event(69, 0, ~KEYEVENTF_KEYUP, 0)
EndIf
RetCode& = 1
ElseIf wParam& = 186 Ü
If lParam& < 0
~keybd_event(85, 0, 0, 0)
~keybd_event(85, 0, ~KEYEVENTF_KEYUP, 0)
~keybd_event(69, 0, 0, 0)
~keybd_event(69, 0, ~KEYEVENTF_KEYUP, 0)
EndIf
RetCode& = 1
ElseIf wParam& = 219 ß
If lParam& < 0
~keybd_event(83, 0, 0, 0)
~keybd_event(83, 0, ~KEYEVENTF_KEYUP, 0)
~keybd_event(83, 0, 0, 0)
~keybd_event(83, 0, ~KEYEVENTF_KEYUP, 0)
EndIf
RetCode& = 1
Else
~CallNextHookEx(hKbdHook&, nCode&, wParam&, lParam&)
RetCode& = 0
EndIf
Return RetCode&
ENDPROC
---------------------------------------------------------------------
Window Style 27
Cls
hKbdHook& = ~SetWindowsHookEx(~WH_KEYBOARD,
@ProcAddr(KbdHookProc, 3), 0,
~GetWindowThreadProcessID(%hWnd, 0))
@Create(MultiEdit, %hWnd, , 10, 10, 600, 210)
@Create(MultiEdit, %hWnd, , 10, 235, 600, 210)
Clear Ende&
WhileNot Ende&
WaitInput
If %Key = 2
Ende& = 1
EndIf
EndWhile
~UnHookWindowsHookEx(hKbdHook&)
-End-------------------------------------------------------------------
End
Info: it is with XProfan not possible, systemweit keyboard-Messages abzufangen.
windows expects a suitable routine in of/ one DLL-File.
|
|
|
| |
|
|