Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 1.16 KB

WTSOpenServer.md

File metadata and controls

50 lines (32 loc) · 1.16 KB

Home

Function name : WTSOpenServer

Group: Terminal Services - Library: wtsapi32


Opens a handle to the specified terminal server.


Code examples:

How to enumerate sessions and processes on a specified terminal server

Declaration:

HANDLE WTSOpenServer(
	LPTSTR pServerName
);  

FoxPro declaration:

DECLARE INTEGER WTSOpenServer IN Wtsapi32;
	STRING pServerName  

Parameters:

pServerName [in] Pointer to a null-terminated string specifying the NetBIOS name of the terminal server.


Return value:

If the function succeeds, the return value is a handle to the specified server.


Comments:

When you are finished with the handle returned by WTSOpenServer, call the WTSCloseServer function to close it.

You do not need to open a handle for operations performed on the terminal server on which your application is running. Use the constant WTS_CURRENT_SERVER_HANDLE instead.