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
How to Read the autoincrement value of Paradox table ?
'Trying to append data to a non-partial dataset' . what does this error indicates?
Compare the similarities and differences among Sockets, DCOM, OLE Enterprise?
How to connect to an InterBase database using the BDE API?
Are there any tools to help me migrate my applications to Delphi?
How to Get the filename and path of a local table?
How to Drop a combobox's list in code?
How to Flush binary file from disk cache to disk ?
How to handle exceptions in Thread objects ?
How to Add hint windows to applications?
How to Create a custom TInplaceEdit for TDBGrid ?
what is Object Activation ?
Why do I get compile errors accessing the Sender object in events?
How to convert a .dfm file to text and vise versa?
what are the different types of dBASE Unique style indexes ?