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
what are Multiple Transports?
How to run executables created in Kylix?
How to make the TDateTimePicker display blank?
How to Set Up a C++ Builder or Delphi Form to View InterBase Data?
'Invalid BLOb handle' error . what does this indicates?
How to Debug an In-Proc COM Server?
How to get the version information for a file?
How to Create a custom TInplaceEdit for TDBGrid ?
Explain about Multi-Threaded ISAPI DLLs ?
How to retrieve an InterBase Blob in Delphi using SavetoFile?
How to use the Find Error entry under the search heading of the menu bar?
How to capture the URL and title of the current webpage being viewed?
How to use a true DWORD value passed to Delphi application?
How to Disable ALT-F4 to prevent form closing
How to Set the MaxPage property of the PrintDialog component?