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 Create resource files?

0 Answers  


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

0 Answers  


How to Write a raw string of data to the printer?

0 Answers  


Why the error "Operation must use an updateable query"?

0 Answers  


How to change a specific IDAPI configuration setting?

0 Answers  


How to Set the caption of the preview window?

0 Answers  


what is Auto increment Build Number?

0 Answers  


How to create a Resource only DLL?

0 Answers  


How to Change RichEdit Font styles with HotKey combinations ?

0 Answers  


How to Change the default project directory ?

0 Answers  


How to create a transparent form?

0 Answers  


How to prevent the user from moving or sizing my form?

0 Answers  


Categories