TreeView_GetCheckState macro

Gets the check state of the specified item. You can also use the TVM_GETITEMSTATE message directly.

Syntax


UINT TreeView_GetCheckState(
   HWND      hwndTV,
   HTREEITEM hItem
);

Parameters

hwndTV

Type: HWND

Handle to the tree-view control.

hItem

Type: HTREEITEM

Handle to the item.

Return value

Returns:

Return codeDescription
Checked

1

Unchecked

0

No Check Box Image

-1

 

Remarks

A tree-view control can have two image lists. The normal image list stores the selected, nonselected, and overlay images. Check boxes are stored in the state image list and displayed to the left of the corresponding normal image. State images are specified by a one-based index. An index of zero indicates that there is no state image. See Tree-View Image Lists for a discussion of how to handle tree-view images.

If you want to define your own state images, this macro assumes that the checked and unchecked images have the same indexes as the standard image list: 1 for unchecked and 2 for checked.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Commctrl.h

 

 

Show: