...determine if the current session is remotely controlled?

Author: Thomas Stutz

Category: Internet / LAN

{
  Call GetSystemMetrics() with the Flag SM_REMOTECONTROL to determine
  if the current session is remotely controlled.
  Its value is TRUE if the current session is remotely controlled;
  FALSE otherwise.
}

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;

 

printed from
www.swissdelphicenter.ch
developers knowledge base