LAN Web TCP Delphi

Title: Easiest way to Interact between Delphi and TWebBrowser (OnLinkClick event for TWebBrowser)
Question: The OnLinkClick-Event of TWebBrowser
The TWebBrowser-object is a great way to display offline html-files
within your application. Sometimes it would be nice to react
within your delphi-application when the user clicks on a link in
the html-view...
Answer:
This article, want to show you how you can interact between "Delphi" and "TWebBrowser".
You must have following lines in header section of your HTML file:

function StatusChange(text) {window.status = text; window.status = ''}

This is simply a JavaScript function that change the status text of "TWebBrowser" component. This function at first change the status text to something that programmer want. But finally erase it and empty the status text. It is a very important part and should not forgot. If you forgot to empty the window.status then Delphi run event for more than one time.
Now when you want to have a Link you must do as a following:
Any thing you want
CMD must be a unique string. This string identify to Delphi that which Link clicked.
Now we must do some thing in our Delphi project. In OnStatusTextChange event of TWebBrowser component type following lines:
if Text = 'CMD' then
begin
// do somthing
end;
I think it was clear and understand the method is easy. We simply change the status text of TWebBrowser and TWebBrowser understand that when status text changes. And so easily we can send any information between Delphi. For example we can send the information about what linck clicked and etc.
It may that you can develop this interact and do much more works!
And for understanding better download sample programs!
Finally I must say: sorry of my bad grammarical errors!
Mohammad Baqer Mamouri
MMamoury@Yahoo.com