Prevent Windows workstation (desktop) from locking while running a WPF program
The solution has been pointed out through the comments, but I’m providing a simple starter solution for anyone else arriving via a web search: /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application { [DllImport(“kernel32.dll”, CharSet = CharSet.Auto, SetLastError = true)] static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags); public App() { … Read more