Changeset 252 for Common/UCommon.pas
- Timestamp:
- Jun 16, 2011, 11:39:42 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/UCommon.pas
r250 r252 6 6 7 7 uses 8 Windows, Classes, SysUtils, SpecializedList, StrUtils, Dialogs, 8 {$IFDEF Windows}Windows,{$ENDIF} 9 Classes, SysUtils, SpecializedList, StrUtils, Dialogs, 9 10 FileUtil; //, ShFolder, ShellAPI; 10 11 … … 29 30 ExceptionHandler: TExceptionEvent; 30 31 DLLHandle1: HModule; 32 33 {$IFDEF Windows} 31 34 GetUserNameEx: procedure (NameFormat: DWORD; 32 35 lpNameBuffer: LPSTR; nSize: PULONG); stdcall; 33 36 {$ENDIF} 34 37 35 38 function IntToBin(Data: Cardinal; Count: Byte): string; … … 41 44 function BCDToInt(Value: Byte): Byte; 42 45 function CompareByteArray(Data1, Data2: TArrayOfByte): Boolean; 46 {$IFDEF Windows} 43 47 function GetUserName: string; 44 48 function LoggedOnUserNameEx(Format: TUserNameFormat): string; 49 {$ENDIF} 45 50 function SplitString(var Text: string; Count: Word): string; 46 51 function GetBit(Variable: QWord; Index: Byte): Boolean; … … 250 255 end; 251 256 257 {$IFDEF Windows} 252 258 function GetUserName: string; 253 259 const … … 283 289 end else Result := GetUserName; 284 290 end; 291 {$ENDIF} 285 292 286 293 function SplitString(var Text: string; Count: Word): string; … … 317 324 procedure LoadLibraries; 318 325 begin 326 {$IFDEF Windows} 319 327 DLLHandle1 := LoadLibrary('secur32.dll'); 320 328 if DLLHandle1 <> 0 then … … 322 330 @GetUserNameEx := GetProcAddress(DLLHandle1, 'GetUserNameExA'); 323 331 end; 332 {$ENDIF} 324 333 end; 325 334 326 335 procedure FreeLibraries; 327 336 begin 337 {$IFDEF Windows} 328 338 if DLLHandle1 <> 0 then FreeLibrary(DLLHandle1); 339 {$ENDIF} 329 340 end; 330 341
Note:
See TracChangeset
for help on using the changeset viewer.