Application-Verifier-Hangs

Windows CE is a customizable OS and custom application has been executed on the top of the OS. Majority of the customers won’t prefer to use the windows CE standard utilities embed on the control panel. Instead they develop their own applications using the standard APIs. During these cases, customer won’t like the standard utility windows popping up on the top of their application.

This is a major requirement from the customers, who are developing custom applications for Kiosks and point of sale terminals. Status window during active sync connection over serial using auto RAS dial application and Wi-Fi zero configuration utility pop up window are typical examples.

Hiding RAS dial status popup window

Usually this window will be popped up while perform the dial up connection over serial modem and connecting the PC through active sync using the auto RAS application to show the connection status. It will disappear after establish the connection. Following procedure hides the popup window.

1) Rnaapp.exe is used to create and maintain the RAS connection and it is a part of the connection manager. Source code is available on wince600/public/common/oak/drivers/netsamp/rnaapp as a library. It is not preferable to change the source code in the public directory.

2) Copy the source code RNAAPP directory to your BSP, perform sysgen capture to find the dependencies and change the sources accordingly. To perform Sysgen capture for RNAAPP read my latest blog Cloning the Rnaapp application using Sysgen_Capture tool

3) Actually the status window is a dialog box and as you know that every dialog box should have a callback function that handles the message for the dialog box. WndProc is a callback function handling the message for the status dialog box and the messages are handled in a switch () case format.

4) IDM_START_RASDIAL is the message, which is responsible for popping up the status window. Here is the code to disable the popup window.

case IDM_START_RASDIAL:
cxScreen = GetSystemMetrics(SM_CXSCREEN);
// Start a RAS Session
memset( (char *)&v_RasDialParams, 0, sizeof( RASDIALPARAMS ) );
v_RasDialParams.dwSize = sizeof(RASDIALPARAMS);
_tcscpy( v_RasDialParams.szEntryName, EntryName );
RasGetEntryDialParams( NULL, &v_RasDialParams, &v_fPassword );
// If this is a dial-up entry, show them the user params
// (Username/Password, etc) to modify before continuing.
// Is this a dial-up entry? (and secret no-password not specified)
// ShowWindow( hWnd, SW_SHOW ); //Change this to hide the window.
ShowWindow( hWnd, SW_HIDE );

5) In the ShowWindow() function, change the SW_SHOW to SW_HIDE option.

This will hide the pop up window.

Hiding the Wi-Fi zero configuration (WZC) utility pop up window

This window will be popped up to configure the SSID and other related parameters to establish the Wi-Fi connection. NETUI.dll and ETHMAN.dll is responsible for adding and maintaining the network connections, adding and removing the connections from system tray etc. Source code for the WZC popup window is the part of the NETUI component. Following procedure hides the popup window.

1) wzcpopup.c is the source file contains the code to enable and disable the popup window. This file is available on wince600/public/common/oak/drivers/ NETUI dir. NETUI will be generated as a DLL during the sysgen phase. It is not preferable to change the source code in the public directory.

2) Copy the NETUI directory to your BSP, perform sysgen capture to find the dependencies and change the sources accordingly.

3) GetDialogPopup(BOOL* pfPopup, DWORD* pdwTimeoutSecs) is the function used by the NETUI and the decision to popup the dialog box has been taken based on the ETHMAN registry settings.

Following registry settings are ETHMAN driver registry settings.

#define HKEY_ETHMAN_POPUP _T(“Drivers\Builtin\Ethman\Popup”)
#define REGVAL_ETM_POPUP_TIMEOUT _T(“Timeout”)
#define REGVAL_ETM_POPUP _T(“Popup”)

Based on the REGVAL_ETM_POPUP value,*pfPopup value is passed to the calling function. This value is changed in two places. If the registry is not exist, it has been created and the *pfPopup value is assigned as TRUE and if the registry is already available, this value is read from the registry. Assigning FALSE to *pfPopup will not allow the WZC window to popup. Here is the partial code to disable the popup window.

// Is the popup check box on ethman suppose to be enabled
DWORD GetDialogPopup(BOOL* pfPopup, DWORD* pdwTimeoutSecs)
{
…..
……
// If this was a new key then let’s set up the values and
// return the default value
if(dwDisp == REG_CREATED_NEW_KEY)
{
……
……
……
// Set popup value
// dwValue = TRUE; //Actual value
dwValue = FALSE; //Changed value
dwErr = RegSetValueEx(hKeyEtm,
REGVAL_ETM_POPUP,
0,
REG_DWORD,
(PBYTE)&dwValue,
sizeof(DWORD));
if(dwErr != ERROR_SUCCESS)
{
goto exit;
}
if(pfPopup)
{
*pfPopup = (BOOL) dwValue;
}
}
else
{
…….
……..
……..
if(pfPopup)
{
cdwValue = sizeof(DWORD);
// Get popup value
dwErr = RegQueryValueEx(hKeyEtm,
REGVAL_ETM_POPUP,
0,
NULL,
(PBYTE)&dwValue,
&cdwValue);
if(dwErr != ERROR_SUCCESS)
{
goto exit;
}
// *pfPopup = dwValue; //Actual code
*pfPopup = FALSE; // Changed value
}

This will hide the pop up window.