LAN Web TCP Delphi

Title: How to determine if the current session is remotely controlled
function IsRemotelyControlled: Boolean;
const
SM_REMOTECONTROL = $2001; // from WinUser.h
begin
Result := Boolean(GetSystemMetrics(SM_REMOTECONTROL));
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if IsRemotelyControlled then
ShowMessage('Remotely controlled.')
else
ShowMessage('Not Remotely controlled.')
end;