Detectar cuando el usuario está activando un campo de texto en Windows

I'm trying to make a keyboard that will pop up when you need it, just like what iPhone web browser does. On Windows that should happen when user activates a textfield on any Window.

After searching I'm planning to try EnumWindows and EnumChildWindows to enumerate all controls. If that works (I doubt) then how can I tell which one is active and if that controls accepts text input? Or is there a better way to achieve what I'm trying to do?

Project uses C++ and Win32 API.

EDIT: Based on rene's comment I can now get the active (child) window handle with SetWinEventHook function and EVENT_OBJECT_FOCUS. But I still can't figure out if it's a window where user can enter text.

Calling GetGUIThreadInfo and comparing returned hwndCaret handle to the window returned by SetWinEventHook callback works partially. It works with for example Notepad and Chrome address bar but not with for example MS Visual Studio child windows.

preguntado el 31 de julio de 12 a las 12:07

Isn't that part of Windows Accessibility features? -

Indeed, looks like accessibility features got everything I need. Thanks for the information. -

@superg Did you try using the GetClassName() function ? -

1 Respuestas

It looks like the functionality you describe is part of the Windows Accessibility features:


Perspectiva del usuario final


Respondido 31 Jul 12, 15:07

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.