Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Sets the item's state image to "checked" or "unchecked." You can also use the TVM_SETITEM message directly.
UINT TreeView_SetCheckState(
HWND hwndTV,
HTREEITEM hti,
BOOL fCheck
);
hwndTV
Type: HWND
Handle to the tree-view control.
hti
Type: HTREEITEM
Handle to the item.
fCheck
Type: BOOL
Value that indicates which state image is displayed. Set fCheck to TRUE to display the checked state image or FALSE to display the unchecked image.
Type: UINT
The return value is not used.
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.
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | commctrl.h |
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today