static extern int GetCurrentThreadId(); //
public static void Start() { var backgroundThread = new Thread(WatchDesktop) { IsBackground = true }; backgroundThread.Start(); Console.WriteLine($"Desktop Task is running on thread: {Desktop.GetCurrentThreadId()}"); }