Help Center

AfxUserNamefunction

Retrieves the name of the user associated with the current thread.

WindowsfunctionAfxWin.incdoc-orphan
No implementation located. This member is documented, but the source scan found no matching declaration. It is likely declared in a header this scan does not resolve, or provided by a macro.

Syntax

FUNCTION AfxGetUserName () AS DWSTRING
Also documented as AfxGetUserName — one description covers them all.

Return value

The name of the current user associated with the current thread.

Description

Retrieves the name of the user associated with the current thread.

Remarks

If the current thread is impersonating another client, the AfxGetUserName function returns the user name of the client that the thread is impersonating.

Reference

  • Include file AfxWin.inc
  • Documented in Windows/Windows Procedures.md
  • Topic: Windows Procedures