When I click a new window button, its always opens in background in Windows 7 64 bit OS.
For my automation task, I need to bring that window to foreground.
Following is my pyautoit code:
autoit.send("{TAB 2}")
sleep(3)
autoit.send("{ENTER}") # After this step new window appears in background
Wnd = autoit.win_wait("[CLASS:#32770]", 15)
autoit.win_activate(Wnd)
sleep(5)
autoit.send("{ENTER}")
I have tried win_wait and win_activate as shown below:
Wnd = autoit.win_wait("[CLASS:#32770]", 15)
autoit.win_activate(Wnd)
But I am getting following error:
WindowsError: exception: access violation reading 0x00000001
Then I tried the "regedit" option as shown in following URL :
http://ask.brothersoft.com/when-i-open-a-program-window-sometimes-it-opens-in-the-background-instead-of-the-foreground-253939.html
But no use. Still I am seeing the same issue.
Could any one help me to fix this issue please?