unit user_ermitteln;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
procedure ErmittleUser(MyWideString: PWideChar);
stdcall;
export;
implementation
procedure ErmittleUser(MyWideString: PWideChar);
stdcall;
export;
var
User_angemeldet:
String;
UserName:
String;
UserNameLen: DWord;
StringLaenge :Integer;
begin
If GetUserName(PChar(UserName), UserNameLen)
Then
begin
User_angemeldet := Copy(UserName,1,UserNameLen - 1);
StringLaenge := Length(User_angemeldet)+1 ;
StringToWideChar(User_angemeldet, MyWideString, StringLaenge);
ShowMessage(User_angemeldet);
end
else
StringLaenge := Length('
unbekannt')+1 ;
StringToWideChar('
unbekannt', MyWideString, StringLaenge)
end;
end.