Freigeben über


Ethman (Windows CE 5.0)

Ethman is a sample application that provides an icon in the notification area that indicates network information, such as IP address and wireless network availability. It also provides a basic configuration dialog box for 802.11 adapters if no previous configuration is available. Ethman is invoked from the sample shell by using the icon in the notification area of the taskbar.

Ethman interacts with the automatic configuration subsystem, and uses the WZCSAPI interface to retrieve and set 802.11 parameters, such as signal strength and visible Service Set Identifier (SSID) list. It uses the NDISUIO interface to register for notifications of adapter insertion or removal. A wrapper is loaded into the user process to communicate with the WZC driver. The WZCSAPI interface is exposed in the header file wzcsapi.h. For more information about these interfaces, see Automatic Configuration Subsystem.

The following table shows the Ethman functions that are exported by NetUI. A sample of these functions and their return values are contained in Ethman.h in the %_WINCEROOT%\Public\Common\Oak\Drivers\Netsamp\Ethman directory.

Function Description Parameters
AddNetUISystrayIcon Adds an icon to the system tray for a network adapter.
  • ptcDeviceName is a unique device name.
  • fWireless indicates the adapter type. TRUE indicates a wireless adapter. FALSE indicates a wired adapter.
  • phWnd is a pointer to the handle of the window associated with the system tray icon.
RemoveNetUISystrayIcon Removes an icon from the tray for a network adapter.
  • ptcDeviceName is a unique device name to remove.
IsPropSheetDialogMessage Netui currently maintains a list that associates a property sheet with each of the HWNDs returned in AddNetUISystrayIcon. Because ethman actually has the message pump, it is necessary to provide this function which should call into PropSheet_IsDialogMessage and return this result.
  • hWnd is a window handle.
  • pMsg is a pointer to the window message.
ClosePropSheetDialogIfReady For a modeless property sheet, the message pump must call into PropSheet_GetCurrentPageHwnd to determine if the property sheet should be destroyed. This function must look up the property sheet of the associated hWnd and destroy the window if necessary.
  • hWnd is window handle.
UpdateConnectionStatus Update the status of a given tray icon to either by connected or not connected.
  • ptcDeviceName is a device name.
  • fConnection indicates the new status of the icon. TRUE indicates connected FALSE indicates not connected.

Note   When Ethman adds a wireless adapter, a dialog box that allows the user to set the wireless properties appears. These properties are then set in the wzcuip.c file for use by the operating system.

The following code example shows the network UI code that is used by ethman.dll to populate its simple wireless dialog box. In this example, rdBSSIDList is used to show visible networks and rdStSSIDList is used to show preferred networks.

HRESULT RefreshWirelessInfo(HWND hwndDlg)
{
       HRESULT             hr            = S_OK;
       DWORD         dwError             = ERROR_SUCCESS;
       SystrayIcon       *pSysIcon    = NULL;
 
       // Get the notification icon for the given window
       hr = GetDeviceSystrayIcon(hwndDlg, &pSysIcon);
       if(FAILED(hr) || !pSysIcon)
       {
              DEBUGMSG(ZONE_ERROR, (TEXT("NETUIQC: Error getting systray icon struct")));
              goto exit;
       }
 
       // If the zero config data has already been deleted, then do not delete it.
       // This should not ever get called, but it is best to be certain.
       // If it does get called, the refresh thread will exit quietly and
       // the notification should resume the next time around.
       if(pSysIcon->WLanInfo.IntfEntry.bInitialized == FALSE)
       {
              hr = E_FAIL;
              goto exit;
       }
       
       pfnWZCDeleteIntfObj(&pSysIcon->WLanInfo.IntfEntry);
 
       pSysIcon->WLanInfo.IntfEntry.wszGuid = pSysIcon->ptcDeviceName;
 
       // GetWireless Info
       if ((dwError = pfnWZCQueryInterface(
                    NULL,
                    INTF_ALL,
                    &pSysIcon->WLanInfo.IntfEntry,
                    &pSysIcon->WLanInfo.dwOIDFlags)) != ERROR_SUCCESS) 
       {
               DEBUGMSG(ZONE_ERROR,(TEXT("NETUIQC: WZCQueryInterface failed 0x%X\r\n"),dwError));
               hr = E_FAIL;
               goto exit;
       }      
 
       FillVisibleList(&pSysIcon->WLanInfo,(PWZC_802_11_CONFIG_LIST)pSysIcon->WLanInfo.IntfEntry.rdBSSIDList.pData);
       FillPreferredList(&pSysIcon->WLanInfo,(PWZC_802_11_CONFIG_LIST)pSysIcon->WLanInfo.IntfEntry.rdStSSIDList.pData);
       FillCurrentConfig(&pSysIcon->WLanInfo,&pSysIcon->WLanInfo.IntfEntry);
       
exit:
       
       return hr;
       
} // RefreshWirelessInfo

For more informaton about Ethman, see Public Common OAK Drivers Directory.

See Also

How to Replace the Network UI for a Target Device | Functions Exported by the Network UI | Connmc | Rnaapp | Pegterm | Public Common OAK Drivers Directory

Last updated on Thursday, February 02, 2006

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.