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 |
How to run executables created in Kylix?
How to dial out through the modem under Win32?
How to Display documents in the default browser?
why Paradox slow on some computers and not on others ?
What are the Differences in the install paths for Kylix?
"Cannot load IDAPI service library" . what does this error mean?
How to have a TBitBtn component that has a word wrapped caption?
How to Generate a Windows Console Application?
How to query dates using Day-Month-Year using local SQL ?
How to retrieve a list of assigned properties ?
How to Create temporary canvas?
How to connect to an InterBase database using the BDE API?