function FindControl(Handle: HWnd): TWinControl;<br>var<br> OwningProcess: DWORD;<br>begin<br> Result := nil;<br> if (Handle <> 0) and (GetWindowThreadProcessID(Handle, OwningProcess) <> 0) and<br> (OwningProcess = GetCurrentProcessId) then<br> begin<br> if GlobalFindAtom(PChar(ControlAtomString)) = ControlAtom then<br> Result := Pointer(GetProp(Handle, MakeIntAtom(ControlAtom)))<br> else<br> Result := Pointer(SendMessage(Handle, RM_GetObjectInstance, 0, 0));<br> end;<br>end;<br>据说GetProp对delphi的编译版本有要求?