How to tell if a textbox is focused in the OS or not?
<p>I need to program a keyboard, with some configurations and customizations.
I need to configure it to be enabled if any text area is focused before the keyboard.
mainly I need to know what control is selected.</p>

<p>The Keyboard is a standalone application, so it cannot deal directly with the controls, just by accessing the OS.</p>

<p>for more explanation, I am gonna tell you the scenario:</p>

<ol>
<li>the user runs the keyboard application, which its 'topmost' is set, and <code>ShowInTaskBar</code> is unset, and the keyboard is disabled.</li>
<li><p>the user clicks on any text control in the window, like the notepad or a TextBox in Microsoft Word or Paint, then after clicking the keyboard application is enabled.</p></li>
<li><p>the user clicks on the keyboard application and its keys to write text on the TextBox selected before in step 2, please note that the previous TextBox will loose focus but the keyboard will still enabled.</p></li>
</ol>
