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 Get the printing margin of the page?

1665


Where is proxies.dcu?

2013


How to close your application using the Escape key?

1597


How to create an icon from a bitmap?

1747


How to Extract Icons ?

1623


How to Converta RGB color to a CMYK color?

1569


How to Launch default browser on a URL?

1712


How to make the TDateTimePicker display blank?

1689


How to Provide lookup capability?

1549


How to Extract an icon from a .exe or .dll?

1585


How does one change the default directory that Delphi uses to save projects?

2198


How to Detect how many jobs are in the print spooler?

1642


How to Change the default width/height of the editor?

1727


How to Print in Delphi without using the TPrinter Unit ?

1756


How to Display a file's associated icon?

1930