OverviewExamples
all_titles = Window.EnumerateTitles();
Gets the window handles and titles of all of the open windows on the user's system and stores them in a table called "all_titles."
-- 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 = "Notepad";
-- Loop through the table of windows.
for handle, title in pairs(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.Close(handle, CLOSEWND_SENDMESSAGE);
end
end
Finds all open windows with the string "Notepad" in the title and sends each of them a close message.
See also: Related Actions