Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to display the current user name?

Answer Posted / clive

use win32 function getUserName

function MyUserFunction : String;
var
pcUserName : pChar; // temporary storage
dwMaxChars : DWORD; // length parameter
Const
MAXCHARS = 255; // max length
begin

dwMaxChars := MAXCHARS;
pcUserName := strAlloc( MAXCHARS + 1 );
try
If not getUserName( pcUserName, dwMaxChars ) Then
result := ''
else
result := String( pcUserName );
finally
strDispose( pcUserName );
end;

end;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to Read the autoincrement value of Paradox table ?

1696


'Trying to append data to a non-partial dataset' . what does this error indicates?

4172


Compare the similarities and differences among Sockets, DCOM, OLE Enterprise?

1461


How to connect to an InterBase database using the BDE API?

1881


Are there any tools to help me migrate my applications to Delphi?

758


How to Get the filename and path of a local table?

1659


How to Drop a combobox's list in code?

1676


How to Flush binary file from disk cache to disk ?

1915


How to handle exceptions in Thread objects ?

1792


How to Add hint windows to applications?

1696


How to Create a custom TInplaceEdit for TDBGrid ?

2325


what is Object Activation ?

1555


Why do I get compile errors accessing the Sender object in events?

916


How to convert a .dfm file to text and vise versa?

1709


what are the different types of dBASE Unique style indexes ?

1488