WTSRegisterSessionNotification

[DllImport("wtsapi32.dll", SetLastError = true)]
public static extern bool WTSRegisterSessionNotification(
   IntPtr hWnd,
   int dwFlags
);

Microsoft documentation: Link

Last updated