I'm working on a Console Application, and I would like to use a function that would activate the display (prevent from going to lock screen)
I Found the below script but it's only working for UWP Projects, Is there any equivelant for Console Application or any available NuGet Package manager Plugins that i can download for the same?
private Windows.System.Display.DisplayRequest _displayRequest;
public void ActivateDisplay()
{
//create the request instance if needed
if (_displayRequest == null)
_displayRequest = new Windows.System.Display.DisplayRequest();
//make request to put in active state
_displayRequest.RequestActive();
}
public void ReleaseDisplay()
{
//must be same instance, so quit if it doesn't exist
if (_displayRequest == null)
return;
//undo the request
_displayRequest.RequestRelease();
}
Thank you very much