def threadFunc(root):
<EOL>th = threading.currentThread()<EOL>auto.Logger.WriteLine('<STR_LIT>'.format(th.ident, th.name), auto.ConsoleColor.Cyan)<EOL>time.sleep(<NUM_LIT:2>)<EOL>auto.InitializeUIAutomationInCurrentThread()<EOL>auto.GetConsoleWindow().CaptureToImage('<STR_LIT>')<EOL>newRoot = auto.GetRootControl()    <EOL>auto.EnumAndLogControl(newRoot, <NUM_LIT:1>)<EOL>auto.UninitializeUIAutomationInCurrentThread()<EOL>auto.Logger.WriteLine('<STR_LIT>'.format(th.ident, th.name), auto.ConsoleColor.Cyan)<EOL>
If you want to use functionalities related to Controls and Patterns in a new thread.
You must call InitializeUIAutomationInCurrentThread first in the thread
    and call UninitializeUIAutomationInCurrentThread when the thread exits.
But you can't use use a Control or a Pattern created in a different thread.
So you can't create a Control or a Pattern in main thread and then pass it to a new thread and use it.