D
DarwinZhang
Unregistered / Unconfirmed
GUEST, unregistred user!
没办法,只好用内嵌汇编了。[]
function DarwinZhangAssigned(P:TObject):Boolean;
const
offset=4;
begin
Result:=False;
if FindHInstance(P)=0 then
exit;
{$IFDEF VER150} //7.0版本
if FindHInstance(PDWord( PDWord(P)^ -offset ))=0 then
exit;
if FindHInstance(Pointer(PDWord( PDWord(P)^ -offset )^))=0 then
exit;
Result:=True;
{$else
}
//其他版本情况
asm
mov edi,p
add edi,$08
db $3b,$3d,$18,$16,$45,$00
jle @@TrueResult
mov @result $0
jmp @@exit
@@TrueResult:
mov @Result,$1
@@exit:
end;
{$ENDIF}
end;
function DarwinZhangAssigned(P:TObject):Boolean;
const
offset=4;
begin
Result:=False;
if FindHInstance(P)=0 then
exit;
{$IFDEF VER150} //7.0版本
if FindHInstance(PDWord( PDWord(P)^ -offset ))=0 then
exit;
if FindHInstance(Pointer(PDWord( PDWord(P)^ -offset )^))=0 then
exit;
Result:=True;
{$else
}
//其他版本情况
asm
mov edi,p
add edi,$08
db $3b,$3d,$18,$16,$45,$00
jle @@TrueResult
mov @result $0
jmp @@exit
@@TrueResult:
mov @Result,$1
@@exit:
end;
{$ENDIF}
end;