Einzelnen Beitrag anzeigen

Benutzerbild von akurka
akurka

Registriert seit: 30. Dez 2008
Ort: Schweiz, 8636 Wald ZH
81 Beiträge
 
Delphi 7 Personal
 
#18

AW: Tastatur Eingabe im Canvas Objekt

  Alt 31. Okt 2014, 08:17
Halo bcvs
Nun das habe ich schon zweimal probiert und jetzt auch noch drittemal.Die Eingabe ins Edit
hat nach dem (Canvas)Bildaufbau kein Focus mehr, obwohl ich Form2.Edit1.SetFocus auch nach dem
BildAufbau aufgerufen habe. Probiere das mal selber, es geht nicht !

Zitat:
We know that focus is the ability to receive user input through the mouse or keyboard. Only the object that has the focus can receive a keyboard event. Some controls, such as TImage, TPaintBox, TPanel and TLabel cannot receive focus. The primary purpose of most graphic controls is to display text or graphics.
If we want to intercept keyboard input for controls that cannot receive the input focus we'll have to deal with Windows API, hooks, callbacks and messages.

Windows Hooks
Technically, a "hook" function is a callback function that can be inserted in the Windows message system so an application can access the message stream before other processing of the message takes place. Among many types of windows hooks, a keyboard hook is called whenever the application calls the GetMessage() or PeekMessage() function and there is a WM_KEYUP or WM_KEYDOWN keyboard message to process.

To create a keyboard hook that intercepts all keyboard input directed to a given thread, we need to call SetWindowsHookEx API function
Ich habe es mit den Tastatur Hook auch bereits probiert, aber vermutlich nur mit local Hook,
was aber nicht funktionierte, man müsste offenbar Global Hook verwenden.
Gruss Anton
Anton Kurka
  Mit Zitat antworten Zitat