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 Create resource files?
'Trying to append data to a non-partial dataset' . what does this error indicates?
How to Write a raw string of data to the printer?
Why the error "Operation must use an updateable query"?
How to change a specific IDAPI configuration setting?
How to Set the caption of the preview window?
what is Auto increment Build Number?
How to create a Resource only DLL?
How to Change RichEdit Font styles with HotKey combinations ?
How to Change the default project directory ?
How to create a transparent form?
How to prevent the user from moving or sizing my form?