Using Win32 functions in Visual FoxPro Image Gallery
Terminal Services
..msdn
WTSCloseServer
WTSEnumerateProcesses
WTSEnumerateServers
WTSEnumerateSessions
WTSFreeMemory
WTSOpenServer
WTSQuerySessionInformation
WTSRegisterSessionNotification
WTSSendMessage
WTSUnRegisterSessionNotification
Code examples:
WTSQuerySessionInformation
..msdn    Add comment     W32 Constants      Translate this page
Retrieves session information for the specified session on the specified terminal server. It can be used to query session information on local and remote terminal servers.
Code examples:
Declaration:
BOOL WTSQuerySessionInformation(
    HANDLE hServer,
    DWORD SessionId,
    WTS_INFO_CLASS WTSInfoClass,
    LPTSTR* ppBuffer,
    DWORD* pBytesReturned
);
FoxPro declaration:
DECLARE INTEGER WTSQuerySessionInformationA IN Wtsapi32;
AS WTSQuerySessionInformation;
    INTEGER hServer,;
    LONG SessionId,;
    INTEGER WTSInfoClass,;
    INTEGER @ppBuffer,;
    LONG @pBytesReturned
Parameters:
hServer
[in] Handle to a terminal server.

SessionId
[in] A Terminal Services session identifier.

WTSInfoClass
[in] Specifies the type of information to retrieve.

ppBuffer
[out] Pointer to a variable that receives a pointer to the requested information.

pBytesReturned
[out] Pointer to a variable that receives the size, in bytes, of the data returned in ppBuffer.

Return value:
If the function succeeds, the return value is a nonzero value.
Usage:
LOCAL hBuffer, nBufsize, nResult, cBuffer
STORE 0 TO hBuffer, nBufsize

* 6=WTSWinStationName
nResult = WTSQuerySessionInformation(m.hServer,;
    nSessionId, 6, @hBuffer, @nBufsize)

IF hBuffer <> 0
    cBuffer = REPLICATE(CHR(0), nBufsize)
    = MemToStr(@cBuffer, hBuffer, nBufsize)
    ? "[" + m.cBuffer + "]"
    = WTSFreeMemory(m.hBuffer)
ENDIF
My comment:
For hServer, specify a handle opened by the WTSOpenServer function, or specify WTS_CURRENT_SERVER_HANDLE to indicate the terminal server on which your application is running.

To free the returned buffer, call the WTSFreeMemory function.
Word Index links for the WTSQuerySessionInformation :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2007-06-08 16:29:12
Modified: 2007-06-11 16:19:58
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.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.224.43.96)
15 sec.Function: 'GdipSetPathGradientCenterPointI'
29 sec.Function: 'GetAncestor'
40 sec.Function: 'SetSysColors'
52 sec.Function: 'FreeLibrary'
1.08 min.Function: 'FormatMessage'
1.3 min.Function: 'VirtualAllocEx'
1.48 min.Function: 'GetKeyState'
1.7 min.Function: 'FindNextVolume'
1.93 min.Function: 'MQCloseQueue'
2.15 min.Function: 'SetCapture'
Google
Advertise here!