[DllImport("wtsapi32.dll", SetLastError = true)] public static extern bool WTSRegisterSessionNotification( IntPtr hWnd, int dwFlags );
Microsoft documentation: Link
Last updated 2 months ago