Click here to Skip to main content
15,900,511 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: visual c++ and thread Pin
3-May-01 6:15
suss3-May-01 6:15 
GeneralExitWindowsEx Problem Pin
Mustafa Demirhan3-May-01 5:15
Mustafa Demirhan3-May-01 5:15 
GeneralPDF View Pin
David Paul Jones3-May-01 4:56
David Paul Jones3-May-01 4:56 
GeneralRe: PDF View Pin
Christian Graus3-May-01 13:26
protectorChristian Graus3-May-01 13:26 
GeneralRe: PDF View Pin
Paul Selormey3-May-01 17:27
Paul Selormey3-May-01 17:27 
GeneralRe: PDF View Pin
Christian Graus3-May-01 17:31
protectorChristian Graus3-May-01 17:31 
GeneralEnhanced drag and drop Pin
wfalby3-May-01 3:50
wfalby3-May-01 3:50 
GeneralRe: Enhanced drag and drop Pin
Tomasz Sowinski3-May-01 4:35
Tomasz Sowinski3-May-01 4:35 
I was able to implement this feature for OLE drag'n'drop in CTreeCtrl. I had to derive the class from COleDropTarget and override OnDragScroll method. This way I was able to handle the scrolling and expanding during the DnD.

I'm including the code here, surely it will be formatted incorrectly, but may be helpful.

DROPEFFECT CNavigationTree::DropTarget::OnDragScroll(CWnd *pWnd, DWORD dwKeyState, CPoint point)
{
DROPEFFECT dropEffect = DropEffectFromKeyState(dwKeyState);
DWORD currentTicks = ::GetTickCount();

CTreeCtrl &tree = *static_cast<ctreectrl *="">(pWnd);
UINT flags;
HTREEITEM hti = tree.HitTest(point, &flags);

if (hti != m_htiLastItem)
{
m_htiLastItem = hti;
m_lastItemTicks = currentTicks;
}

if (currentTicks - m_lastTicks < DD_DEFSCROLLDELAY)
{
return dropEffect;
}

m_lastTicks = currentTicks;

if (NULL != hti)
{
if (point.y < DD_DEFSCROLLINSET)
{
tree.SendMessage(WM_VSCROLL, MAKEWPARAM(SB_LINEUP, 0), NULL);
return dropEffect | DROPEFFECT_SCROLL;
}

CRect rcClient;
tree.GetClientRect(rcClient);
if (point.y > rcClient.bottom - DD_DEFSCROLLINSET)
{
tree.SendMessage(WM_VSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), NULL);
return dropEffect | DROPEFFECT_SCROLL;
}

if (currentTicks - m_lastItemTicks > 500 &&
(flags & (TVHT_ONITEM | TVHT_ONITEMBUTTON)) != 0 &&
tree.ItemHasChildren(hti) &&
tree.GetItemState(hti, TVIS_EXPANDED) != TVIS_EXPANDED)
{
tree.Expand(hti, TVE_EXPAND);
}
}

return dropEffect;
}



Tomasz Sowinski
http://www.shooltz.com.pl
GeneralMFC APP - Copy files from folder to a:\ Pin
Gerry3-May-01 3:45
Gerry3-May-01 3:45 
Questionpassing formatted string as argument??? Pin
hearties3-May-01 3:37
hearties3-May-01 3:37 
AnswerRe: passing formatted string as argument??? Pin
Igor Sukhov3-May-01 4:53
Igor Sukhov3-May-01 4:53 
AnswerRe: passing formatted string as argument??? Pin
David Fedolfi3-May-01 5:54
David Fedolfi3-May-01 5:54 
Generalcapturing window messages with Visual C++ 6.0 Pin
3-May-01 0:51
suss3-May-01 0:51 
GeneralRe: capturing window messages with Visual C++ 6.0 Pin
Igor Sukhov3-May-01 2:46
Igor Sukhov3-May-01 2:46 
GeneralRe: capturing window messages with Visual C++ 6.0 Pin
3-May-01 4:30
suss3-May-01 4:30 
GeneralRe: capturing window messages with Visual C++ 6.0 Pin
Igor Sukhov3-May-01 4:40
Igor Sukhov3-May-01 4:40 
GeneralRe: capturing window messages with Visual C++ 6.0 Pin
Igor Sukhov3-May-01 4:40
Igor Sukhov3-May-01 4:40 
GeneralRe: capturing window messages with Visual C++ 6.0 Pin
3-May-01 5:36
suss3-May-01 5:36 
GeneralRe: capturing window messages with Visual C++ 6.0 Pin
Christian Graus3-May-01 13:28
protectorChristian Graus3-May-01 13:28 
GeneralRe: capturing window messages with Visual C++ 6.0 Pin
3-May-01 5:34
suss3-May-01 5:34 
Generalcan't get the right type of buffer to read file. Pin
hearties3-May-01 0:04
hearties3-May-01 0:04 
GeneralRe: can't get the right type of buffer to read file. Pin
Igor Sukhov3-May-01 1:08
Igor Sukhov3-May-01 1:08 
GeneralRe: can't get the right type of buffer to read file. Pin
hearties3-May-01 1:17
hearties3-May-01 1:17 
GeneralRe: can't get the right type of buffer to read file. Pin
hearties3-May-01 1:22
hearties3-May-01 1:22 
GeneralRe: can't get the right type of buffer to read file. Pin
hearties3-May-01 1:26
hearties3-May-01 1:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.