Pues la sintaxis exacta no sabría decírtela porque la sé para delphi, no para c++ builder, pero debe ser similar. Un ejemplo en Delphi:
Código Delphi
[-]
procedure TForm1.AppEventsIdle(Sender: TObject; var Done: Boolean);
var
Control: TWinControl;
begin
Control := FindVCLWindow(Mouse.CursorPos);
if Assigned(Control) then
Caption := Control.Name;
end;
// Saludos