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?



How to display the current user name?..

Answer / 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

More Delphi Interview Questions

How to run executables created in Kylix?

0 Answers  


How to dial out through the modem under Win32?

0 Answers  


How to Display documents in the default browser?

0 Answers  


why Paradox slow on some computers and not on others ?

0 Answers  


What are the Differences in the install paths for Kylix?

0 Answers  


"Cannot load IDAPI service library" . what does this error mean?

0 Answers  


How to have a TBitBtn component that has a word wrapped caption?

0 Answers  


How to Generate a Windows Console Application?

0 Answers   Satyam,


How to query dates using Day-Month-Year using local SQL ?

0 Answers  


How to retrieve a list of assigned properties ?

0 Answers  


How to Create temporary canvas?

0 Answers   Mastek,


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

0 Answers  


Categories