How can I bypass focus assist's alarm setting for toast messages?

Viewed 696

I have created a custom toast message in Windows 10 that I need to display even when the focus assist setting is set to 'Alarms only'. It appears that with a windows update, the 'Alarms only' setting is set by default when applications go to full screen, when duplicating displays, or playing games. I need a way to either bypass the 'Alarms only' setting, or disable focus assist through a script.

I have attempted to change the setting in group policy as seen here: Manage Focus Assist on Windows 10

as well as through the registry as seen here: How to Change Windows 10 Quiet Hours (Focus Assist) Automatic Rules

Neither of these methods appear to have an affect. Below is my Powershell script that is used to create the toast message:

param(
[String] $Msg1,
[String] $Logo1
)
function test
{
    [void][Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime]
    [void][Windows.UI.Notifications.ToastNotification, Windows.UI.Notifications, ContentType = WindowsRuntime]
    [void][Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime]

$App_ID = 'windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel'

$template = @"
<toast scenario="alarm">
    <visual>
        <binding template="ToastGeneric">
            <text id="1">$("$Msg1")</text>
            <image placement="appLogoOverride" src="$Logo1"/>
        </binding>
    </visual>
</toast>
"@
$xml = New-Object Windows.Data.Xml.Dom.XmlDocument
$xml.LoadXml($template)
$test = New-Object Windows.UI.Notifications.ToastNotification $xml
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($APP_ID).Show($test)
}

if ($Msg1) {test}

The toast message should display by running the script passing the -Msg1 'This is a test' to it. Instead, it does not display, and can only be seen in the action center.

Has anybody been able to display a toast notification regardless of the focus assist (quiet hours) setting? Or does anybody know a method to disable focus assist through a script that appears to work (This needs to be done without user interaction)?

0 Answers
Related