Bom Pessoal depois de augum tempinho sem postar tutoriais, neste aqui vou encinar a vocês a pegar o nome do usuario logado no windows.
1° Declare a Função:
Código PHP:
Function GetNetUserName: string;
Var
NetUserNameLength: DWord;
Begin
NetUserNameLength:=50;
SetLength(Result, NetUserNameLength);
GetUserName(pChar(Result),NetUserNameLength);
SetLength(Result, StrLen(pChar(Result)));
End;
2° Crie um Label.
3° Na aba Events do Form, Procure por OnActive e Clique duas vezes adcionando o code:
Código PHP:
Label1.Caption:=GetNetUserName;
Creditos:
FusioN
Jean Posser