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 |
Why IBM hire you only?
1 Answers Goldman Sachs, IBM, Time,
How to prevent application?s main window from showing when application loads?
How to Hide the windows taskbar?
How to Use the LzExpand functions in your applications?
How to Embede a copyright symbol in a string?
Does the BDE use Client side or server side cursors for MSSQL?
How to Show two forms allowing the first to retain focus ?
Why you want to join IBM only not others like, TCS Infosys, Satyam & Wipro Etc. please do'nt give general answers?.
How to Use InvalidateRect()to repaint the entire form?
How to close your application using the Escape key?
How to Move controls at runtime ?
what is the use of TSocketDispatcher?