Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

Windows Messages

WM_CONTEXTMENU

The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button in the tree control.

Parameters

hwnd = (HWND) wParam;

Window handle of the tree control.

xPos = LOWORD(lParam);

Horizontal position of the cursor, in screen coordinates, at the time of the mouse click.

yPos = HIWORD(lParam);

Vertical position of the cursor, in screen coordinates, at the time of the mouse click.

Comments

A window can process this message by displaying a context menu using the TrackPopupMenu or TrackPopupMenuEx function.

Before displaying a context menu, an application should always send a WM_CANCELMODE message to the tree control.

WM_CTLCOLORLISTBOX

While a standard tree control generates the WM_CTLCOLORLISTBOX which can be handled by the parent window, SftTree/DLL offers a simple API function to define tree colors (see SetCtlColors).

WM_CTLCOLORLISTBOX messages are generated by the tree control for compatibility with SftTree 1.0 only. When developing new applications, please use SetCtlColors instead.

WM_VKEYTOITEM

The WM_VKEYTOITEM message is sent by a tree control with the SFTTREESTYLE_WANTKEYBOARDINPUT style to its parent in response to a WM_KEYDOWN message.

Parameters

wVkey = LOWORD(wParam)

The virtual-key code of the key that the user pressed.

hwnd = (HWND) lParam

Window handle of the tree control.

nCaretPos = HIWORD(wParam)

Caret location (if more than 32K items are added to the tree control, use GetCaretIndex to retrieve a valid caret location).

Returns

The return value specifies the action that the application performed in response to the message. A return value of 2 indicates that the application handled all aspects of selecting the item and requires no further action by the tree control. A return value of 1 indicates that the tree control should perform the default action in response to the keystroke. A return value of 0 or greater specifies the zero-based index of an item in the tree control and indicates that the tree control should perform the default action for the keystroke on the given item.

Comments

A tree control will only support WM_VKEYTOITEM messages if its window style includes the SFTTREESTYLE_WANTKEYBOARDINPUT style.

The WM_VKEYTOITEM message is only generated for keystrokes that are normally handled by the tree control, such as the arrow keys. If other keys need to be processed, the tree control must be subclassed instead.

See Also C/C++ API | Categories | Notifications