Pues por ahí hubiéramos empezado porque un Shape no es un WinControl. Lo único que se me ocurre es hacer un función que recorra todas las componentes del formulario y si es un Shape, vea si el ratón está sobre él:
Código Delphi
[-]
function TForm1.FindShape(const Pos: TPoint): TShape;
var
I: Integer;
begin
Result := nil;
for I := 0 to ComponentCount - 1 do
begin
if Components[i] is TShape then
begin
if PtInRect(TShape(Components[i]).BoundsRect, Pos) then
begin
Result := TShape(Components[i]);
break;
end;
end;
end;
end;
procedure TForm1.AppEventsIdle(Sender: TObject; var Done: Boolean);
var
Shape: TShape;
begin
Shape := FindShape(ScreenToClient(Mouse.CursorPos));
if Assigned(Shape) then
Caption := Shape.Name;
end;
No pongo ahora ejemplo en C porque mi turbo explorer se acaba de quedar congelado
// Saludos