Interface Wtsapi32

All Superinterfaces:
AltCallingConvention, Library, StdCall, StdCallLibrary

public interface Wtsapi32 extends StdCallLibrary
  • Field Details

    • INSTANCE

      static final Wtsapi32 INSTANCE
    • NOTIFY_FOR_ALL_SESSIONS

      static final int NOTIFY_FOR_ALL_SESSIONS
      See Also:
    • NOTIFY_FOR_THIS_SESSION

      static final int NOTIFY_FOR_THIS_SESSION
      See Also:
    • WTS_CONSOLE_CONNECT

      static final int WTS_CONSOLE_CONNECT
      The session identified by lParam was connected to the console terminal or RemoteFX session.
      See Also:
    • WTS_CONSOLE_DISCONNECT

      static final int WTS_CONSOLE_DISCONNECT
      The session identified by lParam was disconnected from the console terminal or RemoteFX session.
      See Also:
    • WTS_REMOTE_CONNECT

      static final int WTS_REMOTE_CONNECT
      The session identified by lParam was connected to the remote terminal.
      See Also:
    • WTS_REMOTE_DISCONNECT

      static final int WTS_REMOTE_DISCONNECT
      The session identified by lParam was disconnected from the remote terminal.
      See Also:
    • WTS_SESSION_LOGON

      static final int WTS_SESSION_LOGON
      A user has logged on to the session identified by lParam.
      See Also:
    • WTS_SESSION_LOGOFF

      static final int WTS_SESSION_LOGOFF
      A user has logged off the session identified by lParam.
      See Also:
    • WTS_SESSION_LOCK

      static final int WTS_SESSION_LOCK
      The session identified by lParam has been locked.
      See Also:
    • WTS_SESSION_UNLOCK

      static final int WTS_SESSION_UNLOCK
      The session identified by lParam has been unlocked.
      See Also:
    • WTS_SESSION_REMOTE_CONTROL

      static final int WTS_SESSION_REMOTE_CONTROL
      The session identified by lParam has changed its remote controlled status. To determine the status, call GetSystemMetrics and check the SM_REMOTECONTROL metric.
      See Also:
    • WTS_CURRENT_SERVER_HANDLE

      static final WinNT.HANDLE WTS_CURRENT_SERVER_HANDLE
      Specifies the current server
    • WTS_CURRENT_SESSION

      static final int WTS_CURRENT_SESSION
      Specifies the current session (SessionId)
      See Also:
    • WTS_ANY_SESSION

      static final int WTS_ANY_SESSION
      Specifies any-session (SessionId)
      See Also:
    • WTS_PROCESS_INFO_LEVEL_0

      static final int WTS_PROCESS_INFO_LEVEL_0
      See Also:
    • WTS_PROCESS_INFO_LEVEL_1

      static final int WTS_PROCESS_INFO_LEVEL_1
      See Also:
  • Method Details

    • WTSRegisterSessionNotification

      boolean WTSRegisterSessionNotification(WinDef.HWND hWnd, int dwFlags)
      Registers the specified window to receive session change notifications.
      Parameters:
      hWnd - [in] Handle of the window to receive session change notifications.
      dwFlags - [in] Specifies which session notifications are to be received. This parameter can be one of the following values.
      Returns:
      If the function succeeds, the return value is TRUE. Otherwise, it is FALSE. To get extended error information, call GetLastError.
    • WTSUnRegisterSessionNotification

      boolean WTSUnRegisterSessionNotification(WinDef.HWND hWnd)
      Unregisters the specified window so that it receives no further session change notifications.
      Parameters:
      hWnd - [in] Handle of the window to be unregistered from receiving session notifications.
      Returns:
      If the function succeeds, the return value is TRUE. Otherwise, it is FALSE. To get extended error information, call GetLastError.
    • WTSEnumerateProcessesEx

      boolean WTSEnumerateProcessesEx(WinNT.HANDLE hServer, IntByReference pLevel, int SessionID, PointerByReference ppProcessInfo, IntByReference pCount)
      Retrieves information about the active processes on the specified Remote Desktop Session Host (RD Session Host) server or Remote Desktop Virtualization Host (RD Virtualization Host) server.
      Parameters:
      hServer - A handle to an RD Session Host server. Specify a handle opened by the WTSOpenServer function, or specify WTS_CURRENT_SERVER_HANDLE to indicate the server on which your application is running.
      pLevel - A pointer to a DWORD variable that, on input, specifies the type of information to return. To return an array of WTS_PROCESS_INFO structures, specify zero. To return an array of WTS_PROCESS_INFO_EX structures, specify one. If you do not specify a valid value for this parameter, on output, WTSEnumerateProcessesEx sets this parameter to one and returns an error. Otherwise, on output, WTSEnumerateProcessesEx does not change the value of this parameter.
      SessionID - The session for which to enumerate processes. To enumerate processes for all sessions on the server, specify WTS_ANY_SESSION.
      ppProcessInfo - A pointer to a variable that receives a pointer to an array of WTS_PROCESS_INFO or WTS_PROCESS_INFO_EX structures. The type of structure is determined by the value passed to the pLevel parameter. Each structure in the array contains information about an active process. When you have finished using the array, free it by calling the WTSFreeMemoryEx function. You should also set the pointer to NULL.
      pCount - A pointer to a variable that receives the number of structures returned in the buffer referenced by the ppProcessInfo parameter.
      Returns:
      If the function succeeds, the return value is a nonzero value. If the function fails, the return value is zero. To get extended error information, call the GetLastError function.
    • WTSFreeMemoryEx

      boolean WTSFreeMemoryEx(int WTSTypeClass, Pointer pMemory, int NumberOfEntries)
      Frees memory that contains WTS_PROCESS_INFO_EX or WTS_SESSION_INFO_1 structures allocated by a Remote Desktop Services function.
      Parameters:
      WTSTypeClass - A value of the WTS_TYPE_CLASS enumeration type that specifies the type of structures contained in the buffer referenced by the pMemory parameter.
      pMemory - A pointer to the buffer to free.
      NumberOfEntries - The number of elements in the buffer referenced by the pMemory parameter.
      Returns:
      If the function succeeds, the return value is a nonzero value. If the function fails, the return value is zero. To get extended error information, call the GetLastError function.