TreeView Control Message

Source: Internet
Author: User

Controlling the role of messages

You can control the TreeView control by sending a message to the TreeView control. Common controls are:

    • Gets the node that was clicked
    • Gets the text of the node
    • Set the text of a node
    • Gets the parent node of the node
    • Gets the child nodes of the node
Tvm_getindent:

wParam: 0;
lParam: 0;
Function: equivalent to MacroTreeView_GetIndent

Tvm_setindent:

wParam: indent;
lParam: 0;
功能: Set indent, equal to macroTreeView_SetIndent

Tvm_getbkcolor:

wParam= 0;
lParam= 0;
功能: Returns the background color COLORREF of the current entire control, equivalent to a macroTreeView_GetBkColor

Tvm_setbkcolor:

wParam= 0;
lParam= ( lParam ) (COLORREF) CLRBK;
功能: Sets the background color, returns the previous background color, the same as the macro TreeView_SetBkColor

Tvm_getitemheight:

wParam= 0;
lParam= 0;
功能: Returns the height of an item, equivalent to a macroTreeView_GetItemHight

Tvm_setitemheight:

wParam= ( wParam ) (short) Cyitem;
lParam= 0;
功能: Sets the height of the item, in pixels, as an even number, for example, set to 33, automatically converted to 32, and set to the height of the bitmap if the value is less than the height of the bitmap (MSDN saying, not actually)

Tvm_gettextcolor:

wParam= 0;
lParam= 0;
功能: Returns the text color of the current tree controlCOLORREF

Tvm_settextcolor:

wParam= 0;
lParam= ( lParam ) (COLORREF) Clrtext;
功能: Sets the color of text

Tvm_insertitem:

wParam= 0;
lParam= ( lParam ) (lptvinsertstruct) Lpis;
功能: Adds an item to the tree control, equivalent to a macroTreeView_InsertItem

Tvm_deleteitem:

lParam= ( lParam ) (Htreeitem) hitem;
功能: Deletes a specified item, equivalent to a macroTreeView_DeleteItem

Tvm_getimagelist:

wParam= ( wParam ) iImage;
lParam= 0;
功能: Returns a handle to the tree control's image list (normal or state), equivalent to a macroTreeView_GetImageList

Tvm_setimagelist:

wParam= ( wParam ) iImage;
lParam= ( lParam ) (himagelist) Himl;
功能: Sets the image list (normal or state), which is equivalent to the macro TreeView_SetImageList , and if Himl NULL , removes the original image list

TVM_GETTOOLTIPSP:

wParam= 0;
lParam= 0;
功能: equivalent to MacroTreeView_GetToolTips

Tvm_settooltips:

wParam= ( wParam ) (HWND) Hwndtooltip;
lParam= 0;
功能: Set Tool tip Bar

Tvm_editlabel:

lParam= ( lParam ) (Htreeitem) hitem;
功能: Start the specified item label replacement equivalent to the macroTreeView_EditLabel

Tvm_endeditlabelnow:

wParam= ( wParam ) (BOOL) Fcancel;
功能: The label edit of the terminating item is equivalent to the macroTreeView_EndEditLabelNow

Tvm_createdragimage:

lParam= ( lParam ) (Htreeitem) hitem;
功能: Creates a drag bitmap for the specified item, creates an image list for the diagram, and joins the bitmap to the image list, which the program uses to display the bitmap when dragging an item, equivalent to a macroTreeView_CreateDragImage

Tvm_getunicodeformat:

wParam= 0;
lParam= 0;
功能: Control uses UNICODE characters to return nonzero, equivalent to macroTreeView_GetUnicodeFormat

Tvm_setunicodeformat:

wParam= ( wParam ) (BOOL) Funicode;
lParam= 0;
功能: Sets whether the control receives Unicode or ANSI characters

Tvm_getscrolltime:

wParam= 0;
lParam= 0;
功能: Returns the maximum scrolling time/times for a tree control? Equivalent to a macroTreeView_GetScrollTime

Tvm_setscrolltime:

wParam= ( wParam ) (UINT) Uscrolltime;
lParam= 0;
功能: Sets the maximum number of scroll times for a tree control

Tvm_setinsertmark:

wParam= ( wParam ) (BOOL) Fafter;
lParam= ( lParam ) (htreeitem) Htiinsert, equal to the macro treeview_setinsertmarkfafter is nonzero, the insertion mark is placed after the item, if zero, the Insertion mark Before

Tvm_getinsertmarkcolor:

wParam= 0;
lParam= 0;
功能: Returns the color of the insertion mark, equivalent to the macroTreeView_GetInsertMarkColor

Tvm_setinsertmarkcolor:

wParam= 0;
lParam= ( lParam ) (COLORREF) Clrinsertmark;
功能: Sets the color of the insertion mark, equivalent to the macroTreeView_SetInsertMarkColor

Tvm_getitem:

wParam= 0;
lParam= ( lParam ) (Lptvitem) Pitem;
功能: Gets the properties of an item, the Hitem member identifies the item to receive the message, the mask member specifies the property to receive, and if mask member = = TVIF_TEXT , the psztext member must set a buffer to receive the text of the item. cchTextMaxset to the size of buffer, if mask member = = TVIF_STATE , the stateMask member must set a status bit for retrieval. On output, the state member contains the values of the specified state bits. Equivalent to a macroTreeView_GetItem

Tvm_setitem

wParam= 0;
lParam= ( lParam ) (const lptvitem) Pitem;
功能: Sets the project's properties, equivalent to the macroTreeView_SetItem

Tvm_sortchildren:

wParam= ( wParam ) (BOOL) Frecurse;
lParam= ( lParam ) (Htreeitem) hitem;
功能: Specifies the sort of child items for the parent project

TVM_SORTCHILDRENCB:

wParam= ( wParam ) (BOOL) Frecurse;
lParam= ( lParam ) (LPTVSORTCB) Psort;
功能: Specifies that child items of the parent project are sorted by a custom callback function

Tvm_getcount:

wParam= 0;
lParam= 0;
功能: The number of items that are returned to the current entire control, equal to the macroTreeView_GetCount

Tvm_getvisiblecount:

wParam= 0;
lParam= 0;
功能: Gets the number of visible items, equivalent to a macro, returns the root item, which is the TreeView_GetVisibleCount TVGN_ROOT first item in the list of items, equivalent to a macroTreeView_GetRoot

Tvm_getnextitem:

wParam= ( wParam ) (UINT) flag;
lParam= ( lParam ) (Htreeitem) hitem;
功能: Returns the handle to item with a relationship with hitem, equivalent to a macro TreeView_GetNextItem
flagcan be one of the following values:

    • TVGN_CARET: Returns the currently selected item equal to Macro treeview_getselection.
    • TVGN_CHILD: Returns the first subproject of the specified project equivalent to macro Treeview_getchild.
    • TVGN_DROPHILITE: Returns the target item of the drag-and-drop operation equal to Macro Treeview_getdrophilight
    • TVGN_FIRSTVISIBLE: Returns the first visible item of a tree control equal to Macro treeview_getfirstvisible
    • TVGN_LASTVISIBLE: Version 4.71, returns the last expanded item of the tree control equal to Macro treeview_getlastvisible
    • TVGN_NEXT: Returns the next sibling of the specified item equivalent to Macro treeview_getnextsibling
    • TVGN_NEXTVISIBLE: Returns the next visible item of the specified item, and the specified item must also be visible, equivalent to the macro treeview_getnextvisible
    • TVGN_PARENT: Returns the parent item of the specified item equal to Macro Treeview_getparent
    • TVGN_PREVIOUS: Returns the previous sibling item of the specified item equivalent to Macro treeview_getprevsibling
    • TVGN_PREVIOUSVISIBLE: Returns the previous visible item of the specified item, and the specified item must also be visible, equivalent to the macro treeview_getprevvisible
Tvm_ensurevisible:

lParam= ( lParam ) (Htreeitem) hitem;
功能: Ensures that the specified item is visible by expanding the parent project or scrolling through the tree Control window, equivalent to Macro treeview_ensurevisible, and returns 0 if the specified item is visible by expanding the parent project, otherwise nonzero.

Tvm_expand:

wParam= ( wParam ) (UINT) flag;
lParam= ( lParam ) (Htreeitem) HItem;
功能: Expands or collapses the specified item, equivalent to the macro Treeview_expand,
Flag can be a combination of one or more values:
Tve_collapse: Folding
Tve_collapsereset: Collapses and deletes its child items, which must be associated with the Tve_collapse
Tve_expand: Expand
Tve_expandpartial: Partially expanded, must be associated with Tve_expand, Version 4.70
Tve_toggle: Folded, unfolded, folded

Tvm_geteditcontrol:

wParam= 0;
lParam= 0;
功能: Returns a handle to the Single-line edit control that is used to edit the label of a tree control item, equivalent to a macro Treeview_geteditcontrol

Tvm_getisearchstring:

wParam= 0;
lParam= ( lParam ) (LPSTR) lpsz;
功能: Gets the search string equivalent to the macro treeview_getisearchstring

Tvm_getitemrect:

wParam= ( wParam ) (BOOL) Fitemrect;
lParam= ( lParam ) (LPRECT) PRC;
: Returns the rectangle of the 功能 specified item, Fitemrect If True, returns only the rectangle of the item text, if False, returns the entire line of the item occupied by the rectangle that is sent when the Htreeitem is placed in lprect (cast), after the message is returned, Lprect the rectangle that stores the item is equivalent to the macro Treeview_getitemrect

Tvm_selectitem:

wParam= ( wParam ) flag;
lParam= ( lParam ) (Htreeitem) hitem;
功能 :

Tvm_hittest:

WParam = 0;
LParam = ( lParam ) (lptvhittestinfo) Lpht;
function : equivalent to Macro treeview_hittest, LPHT is the address of the struct tvhittestinfo, when the message is sent, the PT member specifies the coordinates of the point to be tested, and after the message returns, The Hitem member holds the handle to the item for that coordinate, or null if the coordinate has no items, and the flags member saves the result of the test, and the value of
flags can be one or more of the following combinations:

    • TVHT_ABOVE: Test points are located on the customer area
    • TVHT_BELOW: Located under Customer area
    • TVHT_NOWHERE: Located in the customer area, but under the final item
    • TVHT_ONITEM: On bitmap or label
    • TVHT_ONITEMBUTTON: On the +-number button
    • TVHT_ONITEMICON: On the bitmap
    • TVHT_ONITEMINDENT: In the indentation associated with an item.
    • TVHT_ONITEMLABEL: On the label
    • TVHT_ONITEMRIGHT: Within the area to the right of the project
    • TVHT_ONITEMSTATEICON: The "on" icon for a tree view item "is" in a user-defined state.
    • TVHT_TOLEFT: On the left side of the customer area
    • TVHT_TORIGHT: Located on the right side of the customer area



From for notes (Wiz)



TreeView Control Message

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.