home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2003 July / PCpro_2003_07.ISO / vollvers / edhtml / EdHTMLv5.0.exe / Main / Funkcja_zewnetrzna.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2003-05-14  |  514 b   |  30 lines

  1. {        ..::EdHTML::..      }
  2. {     System Plug-In v1.0    }
  3. { Autor: RaLib Group         }
  4.  
  5. //Przyklad: Funkcja zewnetrzna
  6.  
  7. unit UserNamesff;
  8.  
  9. function GetUserName(lpBuffer: PChar; var nSize: DWORD): BOOL;
  10.   external 'advapi32.dll' name 'GetUserNameA';
  11.  
  12.  
  13. function main: string;
  14. var
  15.   S: string;
  16.   Sz: Integer;
  17. begin
  18.   S := '';
  19.   Sz := 255;
  20.   SetLength(S, Sz);
  21.   if not GetUserName(S, Sz) then
  22.     RaiseLastWin32Error;
  23.   SetLength(S, Sz);
  24.   Result := S;
  25.   ShowMessage(S);
  26. end;
  27.  
  28.  
  29. end.
  30.