IHeaderCtrl2::GetColumnWidth method

The IHeaderCtrl2::GetColumnWidth method retrieves the width, in pixels, of the column.

Syntax

HRESULT GetColumnWidth(
  [in]  int nCol,
  [out] int *pWidth
);

Parameters

  • nCol [in]
    A zero-based index of the column from which the width is to be retrieved.

  • pWidth [out]
    A pointer to width, in pixels, of the column. This parameter must not be NULL.

Return value

This method can return one of these values.

  • S_OK
    The column width was successfully retrieved.

  • E_UNEXPECTED
    The current result view is not the console-provided default view.

  • E_INVALIDARG
    The nCol parameter is not a valid column index.

  • E_POINTER
    The pWidth parameter is NULL.

Remarks

This method can be called successfully even if items are already in the list.

If the column is currently hidden, GetColumnWidth returns 0 (zero) as the column width. However, because a column can have a (0) zero width without being hidden, a return value of (0) zero does not mean that the column is hidden. Therefore, the snap-in should call IColumnData::GetColumnConfigData to identify which columns are hidden.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Mmc.h

DLL

Mmcndmgr.dll

See also

IHeaderCtrl2