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.