IHeaderCtrl::SetColumnWidth method (mmc.h)

Sets the width, in pixels, of a specific column.

Syntax

HRESULT SetColumnWidth(
  [in] int nCol,
  [in] int nWidth
);

Parameters

[in] nCol

A zero-based index that specifies the location of the column relative to other columns in the result pane.

[in] nWidth

A value that specifies the width of the column. This value must be in pixels, or it can be the following value:

MMCLV_AUTO

MMC automatically determines the width of the column based on the width of the text in the column title.

Return value

This method can return one of these values.

Remarks

MMC does not persist in memory any changes made to a column set due to the action of IHeaderCtrl::SetColumnWidth, so snap-ins must update persisted column configuration data after modifying the width of columns in a column set. For more information, see IHeaderCtrl2 and Column Persistence.

The HIDE_COLUMN flag for the nWidth parameter is not supported for SetColumnWidth. If the snap-in must hide the column, it must call IConsole::SelectScopeItem to reselect the scope item and then in the resulting call to the snap-in's MMCN_SHOW notification handler, it must use nWidth=HIDE_COLUMN when inserting the column (in the call to IHeaderCtrl::InsertColumn).

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header mmc.h
DLL Mmcndmgr.dll

See also

IHeaderCtrl

IHeaderCtrl2 and Column Persistence