Detect when user is activating a textfield on 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.