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 use TADOTable Seek procedure?1
How to Disable Full Window Drag?
How to Add a document to the Windows 95 Start Button's documents ?
How to create indexes with the TTable create function?
what is Object Activation ?
How to Connect to a remote CORBA server?
How to Execute a program from my application?
How to use Access97 drivers with BDE 4.51 ?
How to Disable system menu in code?
How to Find the column and row of the cursor in a TRichEdit?
How to Create NonMaintained or .NDX indexes on dBASE Tables?
How to have a TBitBtn component that has a word wrapped caption?