Partager via


WEDF_DefaultAction (Industry 8.1)

7/8/2014

Review the syntax, members, and examples of the WEDF_DefaultAction WMI provider class for Windows Embedded 8.1 Industry (Industry 8.1).

This class configures the default action that Dialog Filter performs on top-level windows that are not in the blocked window list or part of a protected process. The possible actions are to close or to show the window.

Syntax

class WEDF_DefaultAction { 
    [Static] uint32 UpdateDefaultAction (
        [Values{"CLOSE","SHOW"},In] sint32 action
    );
    [Static] uint32 GetDefaultAction (
        [Values{"CLOSE","SHOW"},Out] sint32 cmdletOutput
    );
};

Members

The following table lists the methods that belong to this class.

Methods

Method

Description

WEDF_DefaultAction.GetDefaultAction

Gets the default action for Dialog Filter.

WEDF_DefaultAction.UpdateDefaultAction

Changes the default action for Dialog Filter.

Remarks

You can hide all windows except those created by specific applications. To do this, set the default action to Close, and add the specific applications to the protected processes list using WEDF_ProtectedProcess.

If you set the default action to Close and you use the Windows shell, you must add explorer.exe as a protected process in order to prevent Dialog Filter from blocking certain Windows UI elements such as charms and swipe to close.

Example

The following example demonstrates how to modify the default action for Dialog Filter by using the Windows Management Instrumentation (WMI) provider in a Windows PowerShell script.

$COMPUTER = "localhost"
$NAMESPACE = "root\standardcimv2\embedded"

# Define common parameters

$CommonParams = @{"namespace"=$NAMESPACE; "computer"=$COMPUTER}

# Create handle to the class instance so we can call the static methods

$classDefaultAction = [wmiclass]"\\$COMPUTER\${NAMESPACE}:WEDF_DefaultAction"

# Create some helper variables

$DefaultActionList = @("close", "show")
$DefaultClose = 0
$DefaultShow = 1

function Get-DefaultAction() {

# Display the current default action for Dialog Filter

    $DefaultAction = $classDefaultAction.GetDefaultAction().cmdletOutput

    Write-Host "The default action for Dialog Filter is currently set to" $DefaultActionList[$DefaultAction] "windows by default."
}

function Set-DefaultAction($action) {

# Set the default action for Dialog Filter

    $classDefaultAction.UpdateDefaultAction($action) | Out-Null

    Write-Host "The default action for Dialog Filter has been updated to" $DefaultActionList[$action] "windows by default."
}

# Use the functions to change the default action

Get-DefaultAction

Set-DefaultAction($DefaultClose)

Get-DefaultAction

Set-DefaultAction($DefaultShow)

Get-DefaultAction 

See Also

Reference

Dialog Filter WMI provider reference

Concepts

Dialog Filter