How to set focus on a popup window?

Hi,

This question is more to do with Watir. How do I switch focus on a popup
window and continue working in it? I’ve tried this:
hwnd = @ie.enabled_popup(4)
if(hwnd)
w=WinClicker.new
w.makeWindowActive(hwnd)
hwnd.image(:name, ‘search’).click
end

But it didn’t work. Could someone has a clue?

Thanks,
maung