+ // Gets Chooser name of user by examining a System resource.
+
+ const short kComputerNameID = -16413;
+
+ short oldResFile = CurResFile() ;
+ UseResFile(0);
+ StringHandle chooserName = (StringHandle)::GetString(kComputerNameID);
+ UseResFile(oldResFile);
+
+ if (chooserName && *chooserName)
+ {
+ int length = (*chooserName)[0] ;
+ if ( length + 1 > maxSize )
+ {
+ length = maxSize - 1 ;
+ }
+ strncpy( buf , (char*) &(*chooserName)[1] , length ) ;
+ buf[length] = 0 ;
+ }
+ else
+ buf[0] = 0 ;
+
+ return TRUE;