Dialog Box Filter is a new feature in Windows Embedded Standard 2011. Dialog Box Filter can be used to prevent dialogs or windows from appearing on your embedded system. In order to use Dialog Box Filter properly it is important that you understand how it performs this task. This article will explain how Dialog Box Filter works and its limitations, as well as how to troubleshoot issues.
The Dialog Box Filter feature has 4 main components:
- Dialog Box Service
- Dialog Box Filter
- Dialog Filter Editor
Dialog Box Service
The Dialog Box Service works with the Dialog Box Filter code to capture windows and decide whether they should be filtered. The service is always active and works in the context of the logged on user.
Dialog Box Filter
The filter code is responsible for blocking windows. The filter code can be replaced with a custom filter using an SDK supplied in the Windows Embedded Standard 2011 toolkit. The rest of this section refers to the default filter supplied and supported by Microsoft.
The default filter reads its configuration from the ConfigurationList.XML data file. In order to prevent the windows appearance, windows are relocated to an off screen coordinate before the window is displayed. The filter then waits for the window to be drawn (off screen) and then interrogates the windows information. The information used to identify a window is a combination of:
- The process name
- The window Title
- The window class
- The buttons on the window (names)
Any of the buttons can be used as an action to be taken to dismiss the window. It is the OEM’s responsibility to verify that the action closes the window. If a windows is not closed by the action taken, then the windows will remain off screen and the system’s stability could be compromised.
Dialog Filter Editor
The Dialog Filter Editor is a GUI tool that can be used to configure the default Dialog Box Filter. It can be used on any Windows Embedded Standard 2011 runtime that includes Dialog Box Filter or any Windows 7 machine. The Dialog Filter Editor is installed with the Windows Embedded Standard 2011 tools.
The editor allows you to choose any window currently shown. After adding a new filter you can choose an action from a pull down menu. The file created by the Dialog Filter Editor can be added to a runtime through Image Configuration Editor (ICE) or by placing it in the correct directory on an existing runtime.
This is the data file used by the default Dialog Box Filter implementation. The file must reside on the Windows Embedded Standard 2011 runtime in the directory: ProgramData\Microsoft\DialogFilter\. The file should not be edited manually (see troubleshooting issues below for an exception).
Below is some important information required to use Dialog Box Filter correctly.
Data from the Dialog Filter Editor and the Dialog Box Filter are not the same:
The Dialog Filter Editor and the Dialog Filter Service may see different data (Process name, Window Title, Class Id, Button names) due to the fact that they interrogate windows at different times in the window life cycle. The Dialog Filter Service interrogates the window immediately after it is drawn whilst the editor interrogates a window long after that stage. This may cause the data from the editor to be incorrect because there are cases where the window changes one or more of the filter criteria (Process name, Window Title, Class Id, Button names) after the window is initially drawn. One such family of windows that has this issue is document applications. These applications use the title bar to show the document currently being operated on. In these applications, the title is updated after the window is initially drawn- therefore the data the Dialog Filter Editor sees (with the document title) will not work with the Dialog Filter Service.
If a configured window is not closed as expected you should use the Dialog Box Filter logging option to verify what the correct xml filter data should be. To do this:
- Run the event viewer (eventvwr.exe)
- Go to Applications and Services Log/Microsoft/Windows/Dialog Filter/Operational
- Enable the log (either in the right window pane or by using the right mouse button on the Operational directory).
- From this point on the Dialog Filter will log all windows it finds to the operational log. The information for a window will include an XML snippet that can be copied to the configuration file.
The log entries will include the XML snippet that the Dialog Filter Service sees when interrogating a window. The log file XML data should be used to replace the data from the Dialog Filter Editor. This can be done using the Dialog Filter Editor (manually changing entries) or by editing the xml file manually (which is necessary only if the button titles are different). Please use care while editing the xml file and be sure to save the file in a unicode format (This can be done using notepad if you choose the save as option and choose utf-8).
Dialog Filter Service does not log a window that has appeared (and does not block it)
There are certain windows that are not caught by the Dialog Box Filter. These include applications with elevated permissions (UAC) and special applications (such as Magnifier) which do not create a regular window. There are also special button types (e.g. Split Buttons) which are not captured.
Custom Dialog Box filters
The feature includes the ability to create a custom Dialog Box Filter implantation. This can be used to implement a solution not supported by our default implementation (e.g blocking all windows not from a specific process or adding wildcard support). An example implementation is supplied with the feature.