SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Starts a timer for the specified item, so a SFTTREEN_AUTOEXPANDING notification will be sent.
C
BOOL WINAPI SftTree_StartAutoExpandTimer(HWND hwndCtl, int index, BOOL fDeselectedItemsOnly, UINT elapse); BOOL WINAPI SftTreeSplit_StartAutoExpandTimer(HWND hwndCtl, int index, BOOL fDeselectedItemsOnly, UINT elapse);
C++
BOOL CSftTree::StartAutoExpandTimer(int index, BOOL fDeselectedItemsOnly, UINT elapse); BOOL CSftTreeSplit::StartAutoExpandTimer(int index, BOOL fDeselectedItemsOnly, UINT elapse);
hwndCtl
The window handle of the tree control.
index
Defines the zero-based index of the item, for which a SFTTREEN_AUTOEXPANDING notification will be sent once the timer expires.
fDeselectedItemsOnly
Set to TRUE to send a SFTTREEN_AUTOEXPANDING notification only if the item described by index is not selected. Otherwise, if fDeselectedItemsOnly is FALSE, the SFTTREEN_AUTOEXPANDING notification will be sent regardless of the selection status of the item.
elapse
Defines the time interval (in milliseconds) when the SFTTREEN_AUTOEXPANDING notification will be sent.
StartAutoExpandTimer returns TRUE if the function was successful, otherwise FALSE is returned.
The StartAutoExpandTimer function starts a timer for the specified item, so a SFTTREEN_AUTOEXPANDING notification will be sent.
This function is normally used during drag & drop processing to implement autoexpanding folders when the mouse cursor hovers over a collapsed folder. Once StartAutoExpandTimer is called, the SFTTREEN_AUTOEXPANDING notification will be sent after elapse milliseconds. If StartAutoExpandTimer is called again before the SFTTREEN_AUTOEXPANDING notification is sent, a pending timer is canceled and the timer is restarted.
StopAutoExpandTimer can be used to cancel the timer.
Once the SFTTREEN_AUTOEXPANDING notification is sent, the application can use the GetExpandCollapseIndex function to retrieve the index of the item to expand.
lpInfo->fDropOK = TRUE; lpInfo->hCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DRAG)); // update the drop target in the right tree pt = lpInfo->ptDrag; MapWindowPoints(HWND_DESKTOP, m_hwndRightTree, &pt, 1); index = SftTree_CalcIndexFromPointEx(m_hwndRightTree, &pt); SftTree_SetDropHighlight(m_hwndRightTree, index, TRUE); SftTree_StartAutoExpandTimer(m_hwndRightTree, index, FALSE, 0); // remember who is the drop target m_hwndLastTarget = m_hwndRightTree; } } else { // left side tree is the drop target // clear old drop target if different
lpInfo->fDropOK = TRUE; lpInfo->hCursor = AfxGetApp()->LoadCursor(IDC_DRAG); // update the drop target in the right tree CPoint pt = lpInfo->ptDrag; ::MapWindowPoints(HWND_DESKTOP, m_RightTree.m_hWnd, &pt, 1); int index = m_RightTree.CalcIndexFromPointEx(&pt); m_RightTree.SetDropHighlight(index, TRUE); m_RightTree.StartAutoExpandTimer(index, FALSE, 0); // remember who is the drop target m_lastDropTarget = &m_RightTree; } } else { // left side tree is the drop target // clear old drop target if different
See Also C/C++ API | Categories | Notifications