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 |
'General SQL Error : Connection does not exist' in threaded application . what does this indicates?
How to display seconds, minutes, tracks of an AVI ?
How to detect if the current user is logged in administrator?
How to get the coding for : Well-ordered numbers
How to Create a palette with more than one entry ?
How to Use an instance of TPrinter ?
How to Print a WEB page with the HTML control?
How to Prevent changing pages in a page control?
How to get the version information for a file?
How to Get a handle on your files ?
Define PRIMARYLANGID(), SUBLANGID(), and MAKELANGID() macros?
How to Modify application server SQL from the client?