This component was born out of frustration, since I wasn't able to connect to an existing instance of Internet Explorer AND catch the events it fires. There must be a better way to do it, let me know if you have figured it out. I use timers.
EIdNotFound = class(Exception);
TSHELLMESSAGE = (smClose,smMaximize,smMinimize,smRestore);
TShellWindow = class Num : integer; handle : HWND; LocationURL : String; LocationName : String; IEHandle : IWebBrowser2; end;
TOnAddedEntry = procedure (Sender : TObject; ShellWindow : TShellWindow; Str : String) of object;
Str
is in the form ID:URL:TITLE:TIME
, and it is added at the end of the LoggedChanges
Property, and the delimiter, in this example :, is set through the Delimiter
PropertyTOnChangedNumber = procedure (Sender : TObject; Number : Integer) of object;
Fired whenever an instance of Internet Explorer is closed or opened. Number
is the current number of opened instances
LoggingDirs : Boolean
Delimiter : Char
Active : boolean
LoggedChanges (runtime) : TStrings
WindowList : TList (runtime)
Contains a list of active
TShellWindow(s)
Count : Integer
Number of active instance of explorer
SendAMessage : TShellMessage =
Allow you to choose the type of message you
send at the choosen instance function GetShellWindowOnId(Id : integer) : TShellWindow;
function SendMessageToWindowByNumber(Num: Integer): LRESULT;
Allow you to send a choosen message at an explorer's instance by th Num parameter. Return the result of sending. For more information see Help for the return of SendMessage function API.
OnAddedEntry : TOnAddedEntry;
OnChangedNumber : TOnChangedNumber;