Using Win32 functions in Visual FoxPro Image Gallery
System Information
..msdn
ExpandEnvironmentStrings
GetComputerName
GetComputerNameEx
GetComputerObjectName
GetCurrentHwProfile
GetKeyboardType
GetNativeSystemInfo
GetProductInfo
GetSysColor
GetSystemDirectory
GetSystemInfo
GetSystemMetrics
GetSystemRegistryQuota
GetSystemWow64Directory
GetUserName
GetUserNameEx
GetVersion
GetVersionEx
GetWindowsDirectory
IsNetworkAlive
SetComputerName
SetSysColors
SystemParametersInfo
Code examples:
GetUserNameEx
..msdn    Add comment     W32 Constants      Translate this page
Retrieves the name of the user or other security principal associated with the calling thread. You can specify the format of the returned name.
Code examples:
Declaration:
BOOLEAN WINAPI GetUserNameEx(
  __in     EXTENDED_NAME_FORMAT NameFormat,
  __out    LPTSTR lpNameBuffer,
  __inout  PULONG lpnSize
);
FoxPro declaration:
DECLARE INTEGER GetUserNameEx IN secur32;
    INTEGER NameFormat,;
    STRING @lpNameBuffer,;
    LONG @lpnSize
Parameters:
NameFormat [in]
The format of the name. This parameter is a value from the EXTENDED_NAME_FORMAT enumeration type.

lpNameBuffer [out]
A pointer to a buffer that receives the name in the specified format.

lpnSize [in, out]
On input, this variable specifies the size of the lpNameBuffer buffer, in TCHARs.
Return value:
If the function succeeds, the return value is a nonzero value.
Usage:
LOCAL cBuffer, nBufsize

* 1332=ERROR_NONE_MAPPED
* 87=ERROR_INVALID_PARAMETER
FOR nIndex=0 TO 13
    nBufsize=250
    cBuffer = REPLICATE(CHR(0), nBufsize)

    nResult = GetUserNameEx(nIndex, @cBuffer, @nBufsize)

    IF nResult <> 0
        cBuffer = SUBSTR(cBuffer, 1, nBufsize)
        ? nIndex, "["+cBuffer+"]"
    ELSE
        ? nIndex, "error:", GetLastError()
    ENDIF
NEXT
My comment:
If the thread is impersonating a client, GetUserNameEx returns the name of the client.
Word Index links for the GetUserNameEx :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2009-01-07 12:38:32
Modified: 2009-01-07 12:44:00
Visited in last 7 days: 10
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.198.2.110)
12 sec.Project
23 sec.Function: 'GetPhysicalMonitorsFromHMONITOR'
33 sec.Function: 'DeleteEnhMetaFile'
Function group: 'Metafile'
59 sec.Function: 'mmioClose'
Function group: 'Windows Multimedia'
1.22 min.Function: 'DeleteFile'
Function group: 'File Management'
1.45 min.Function: 'GdipGetFamilyName'
Function group: 'GDI+ Font'
1.65 min.Function: 'waveInClose'
Function group: 'Windows Multimedia'
1.85 min.Function: 'FindFirstFile'
Function group: 'File Management'
2.07 min.Function: 'GetSubMenu'
Function group: 'Menu'
2.28 min.Function: 'CeGetLastError'
Function group: 'Remote Application Programming (RAPI)'
Google
Advertise here!