Platform SDK: RAS/Routing and RAS

RasMonitorDlg

The RasMonitorDlg function displays the Dial-Up Networking Monitor property sheet that describes the status of RAS connections.

BOOL RasMonitorDlg(
  LPTSTR lpszDeviceName,  // pointer to the name of the device to 
                          // display initially
  LPRASMONITORDLG lpInfo  // pointer to structure that contains 
                          // input and output parameters
);

Parameters

lpszDeviceName
Pointer to a null-terminated string that specifies the name of the device to display initially. If this parameter is NULL, or if the specified device does not exist, the property sheet displays the first device.
lpInfo
Pointer to a RASMONITORDLG structure that contains additional input and output parameters. On input, the dwSize member of this structure must specify sizeof(RASMONITORDLG). If an error occurs, the dwError member returns an error code; otherwise, it returns zero.

Return Values

If the user hangs up a connection, the return value is a nonzero value.

If an error occurs, or if the user closes the dialog box without hanging up a connection, the return value is zero. If an error occurs, the dwError member of the RASMONITORDLG structure returns a nonzero system error code or RAS error code.

Remarks

The following sample code invokes the RAS monitor dialog.

lpInfo = (LPRASMONITORDLG)GlobalAlloc(GPTR, sizeof(RASMONITORDLG));
 
ZeroMemory(lpInfo, sizeof(RASMONITORDLG));
// Essential, since garbage values cause the API to fail
lpInfo->dwSize=sizeof(RASMONITORDLG);
 
nRet = RasMonitorDlg(NULL,lpInfo);
 
if (nRet)
    printf("User hung up the connection\n");
else
{
    if (lpInfo->dwError != 0)
    {
        printf("RasMonitorDlg failed: Error = %d\n", lpInfo->dwError);
        return -1;
    }
    else
        printf("User pressed Close\n");
}

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Unsupported.
  Header: Declared in Rasdlg.h.
  Library: Use Rasdlg.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.

See Also

Remote Access Service (RAS) Overview, Remote Access Service Functions, RASMONITORDLG