Registriert seit: 1. Jul 2003
Ort: Mannheim
919 Beiträge
Delphi 7 Personal
|
Re: Liste aller Windows-Benutzer
18. Nov 2005, 23:38
Damit sollte es geht:
Delphi-Quellcode:
var
EntiesRead: DWORD;
TotalEntries: DWORD;
UserInfo: lpUSER_INFO_1;
lpBuffer: Pointer;
ResumeHandle: DWORD;
Counter: Integer;
NetApiStatus: LongWord;
repeat
NetApiStatus := NetUserEnum(nil, 1, 0, lpBuffer, 0, EntiesRead,
TotalEntries, ResumeHandle);
UserInfo := lpBuffer;
for Counter := 0 to EntiesRead - 1 do
begin
listbox1.Items.Add(WideCharToString(UserInfo^.usri1_name));
Inc(UserInfo);
end;
NetApiBufferFree(lpBuffer);
until (NetApiStatus <> ERROR_MORE_DATA);
MfG Jonas
|