Win32Api-Focus

From a unittest script, I launch an application (say notepad.exe) using WinExec from a test method. In the same method, and hence the same test instance, I post mouse move events and hence bring up the Find window of notepad. Now I want to find out which control in this Find window has the focus. So I do a win32api.GetFocus() and this method call returns an error saying ‘No window has the focus’. Before launching notepad, when I do a win32api.GetFocus(), I get the handle of the pythonwin editor from where I run the test script.

Can anyone help as to what the problem could be. Is it because the thread that is running notepad is different from the one that is runnig the test instance? If so, what is the solution.

Thanks in advance.

Regards

Bala