判断ActiveForm是否在浏览器内被调用:
var
hWnd : THandle;
CNameChar;
begin
try
GetMem(CName,100);
hWnd := Self.ParentWindow;
if hWnd <> 0 then
hWnd:=GetParent(hWnd);
if hWnd <> 0 then
hWnd:=GetParent(hWnd);
if hWnd <> 0 then
GetClassName(hWnd, CName, 100);
if CName = 'IEFrame' then
ShowMessage('It is IE!!');
finally
FreeMem(CName);
end;