2007. április 25., szerda

Close all the open IE windows


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.

Nincsenek megjegyzések:

Megjegyzés küldése