File.Open("AutoPlay\\Flash\\blockocide.swf", "AutoPlay\\Flash", SW_SHOWNORMAL);
-- let the swf launch
Application.Sleep(1000);
-- Get the titles and window handles of all open windows.
windows = Window.EnumerateTitles();
-- A variable containing text in the title you want to search for.
window_name = "Macromedia Flash Player 9";
--window_name = "Macromedia Flash Player 8"; --<<< might want to check for other versions
-- Loop through the table of windows.
for handle, title in windows do
-- Check if the window title has the target text.
result = String.Find(title, window_name, 1, false);
-- if the string was found in the title, send the window a close message.
if (result ~= -1) then
Window.SetOrder(handle, HWND_TOPMOST);
end
end