Hi William,
Unfortunately, I am afraid that I will disappoint you... as personally I was getting the mentioned error when the control was really not able to get the focus. The reason could be that either control was absent, or was not internally completely initialized and thus did not respond to the messages sent to it in the expected way, or for some other reason.
In my code I used to use <control>.SetFocus to explicitly set focus to the control when this is needed. Actually, I even used to something like this:
<window>.Activate
<control>.SetFocus
The first statement explicitly activates the window the test code will work with and this helps to prevent false negatives if some unexpected error/warning message is displayed. (OnUnexpectedWindow event will be triggered and at least the message along with the screenshot will be posted to the log.)
The second statement explicitly sets the focus the the target control and sometimes this helps if the control does something in the background when getting focus (e.g. options list is filled with data for some customized combobox).
> The 'Keys' method is suppose to set the focus.
To say the truth, I am not sure that this is done explicitly by TestComplete. It is my understanding that .Keys just sends a corresponding event to the target control. And then it is either OS or the tested application that will or will not set the focus to this or that control. As an example, consider this sample string for .Keys: "1[Tab]2" - in most cases it will enter '1' into the currently active control, then move to another control and enter '2' to this another control. I am really doubting that TestComplete within .Keys() call somehow controls what control must be focused when the press of the Tab key is emulated. This is, basically, the reason for my current understanding.
Not sure if all the above helps somehow, but anyway... :)
P.S.
> "Donald Trump Supports TestComplete".
I can't but welcome this his decision! Great job and strong move of SmartBear's management that we all will definitely benefit from.
;)