My application uses SendKeys to navigate through and enter data into the input fields (I know that is not the bestway to do it, but I have to work with this limitation). Now, I want to make sure that the correct window is active when the SendKeys are at work.
One way to do confirm this is to check for the current active window before every SendKeys commmand. But that sounds very exhaustive? Is there a better way to do this? I don’t know much but am guessing using Multithreading? Any ideas?
As far as I understand from your post you send messages to windows that do not belong to your application. If so, then I’m afraid you have to check active window before every SendKeys call.