unit machineNames; { Michael Gibbs } { This unit provides routines for retrieving the owner and machine } { names set by the File Sharing control panel. } interface uses Types; procedure GetOwnerName (var theName: Str255); procedure GetMachineName (var theName: Str255); implementation uses TextUtils; procedure GetOwnerName (var theName: Str255); const owner_id = -16096; var sh: StringHandle; begin sh := GetString(owner_id); if sh = nil then theName := '' else theName := sh^^; { Don't release it, someone else may be using it } end; procedure GetMachineName (var theName: Str255); const machine_id = -16413; var sh: StringHandle; begin sh := GetString(machine_id); if sh = nil then theName := '' else theName := sh^^; { Don't release it, someone else may be using it } end; end.