procedure TtestX.Close;
var
ParentWnd: HWND;
ClassNameBuf: array[0..255] of Char;
begin
ParentWnd := GetParent(Handle);
while ParentWnd <> 0 do
begin
FillChar( ClassNameBuf, SizeOf(ClassNameBuf), 0 );
GetClassName( ParentWnd, ClassNameBuf, SizeOf( ClassNameBuf ) );
if ClassNameBuf = 'IEFrame' then
PostMessage(ParentWnd, WM_CLOSE, 0, 0);
아래 코드로 하면 될겁니다..
procedure TtestX.Close;
var
ParentWnd: HWND;
ClassNameBuf: array[0..255] of Char;
begin
ParentWnd := GetParent(Handle);
while ParentWnd <> 0 do
begin
FillChar( ClassNameBuf, SizeOf(ClassNameBuf), 0 );
GetClassName( ParentWnd, ClassNameBuf, SizeOf( ClassNameBuf ) );
if ClassNameBuf = 'IEFrame' then
PostMessage(ParentWnd, WM_CLOSE, 0, 0);
ParentWnd := GetParent(ParentWnd);
end;
end;