function IsRemoteSession: boolean; (* const sm_RemoteSession = $1000; *) begin result := GetSystemMetrics(sm_RemoteSession) <> 0; end;