¡@

Home 

c# Programming Glossary: wtsapi32.dll

How do you retrieve a list of logged-in/connected users in .NET?

http://stackoverflow.com/questions/132620/how-do-you-retrieve-a-list-of-logged-in-connected-users-in-net

namespace EnumerateRDUsers class Program DllImport wtsapi32.dll static extern IntPtr WTSOpenServer MarshalAs UnmanagedType.LPStr.. MarshalAs UnmanagedType.LPStr String pServerName DllImport wtsapi32.dll static extern void WTSCloseServer IntPtr hServer DllImport wtsapi32.dll.. static extern void WTSCloseServer IntPtr hServer DllImport wtsapi32.dll static extern Int32 WTSEnumerateSessions IntPtr hServer MarshalAs..

Start a windows service and launch cmd

http://stackoverflow.com/questions/4147821/start-a-windows-service-and-launch-cmd

WinStationName public ConnectionState State DllImport wtsapi32.dll CharSet CharSet.Auto SetLastError true public static extern.. out PROCESS_INFORMATION lpProcessInformation DllImport wtsapi32.dll public static extern void WTSFreeMemory IntPtr memory DllImport.. extern UInt32 WTSGetActiveConsoleSessionId DllImport wtsapi32.dll SetLastError true static extern int WTSQueryUserToken UInt32..

Logoff interactive users in Windows from a service

http://stackoverflow.com/questions/5207506/logoff-interactive-users-in-windows-from-a-service

this. Below sample works only with Admin Rights DllImport wtsapi32.dll SetLastError true static extern bool WTSLogoffSession IntPtr.. System.IntPtr ppBuffer out uint pBytesReturned DllImport wtsapi32.dll SetLastError true static extern IntPtr WTSOpenServer MarshalAs.. MarshalAs UnmanagedType.LPStr String pServerName DllImport wtsapi32.dll static extern void WTSCloseServer IntPtr hServer DllImport wtsapi32.dll..