Mirror

Close all the open IE windows (Views: 709)


Problem/Question/Abstract:

How can I close all the open internet explorer windows currently open?

Answer:

Use this to close all open IE windows.

var
  IExplorer: Thandle;
begin
  IExplorer := FindWindow('' IEFrame '', nil);
  if IExplorer <> 0 then
    SendMessage(IExplorer, WM_SYSCOMMAND, SC_CLOSE, 0);

note instead of SC_CLOSE

SC_MINIMIZE can be used to minimize all ie windows
SC_MAXIMIZE can be used to maximize all ie windows

This could be used on a button click or in a timer for example.

<< Back to main page