Solved

Drag/Drop on CTabCtrl?

Posted on 2000-03-17
3
633 Views
Last Modified: 2013-11-20
Hi,

A friend of mine is using a class derived from the CTabCtrl and wants to add drag and drop to it. The problem he gets with drag and drop is that he only can drop on the tab area of the control and not on the client area. The new class has not changed any parts that can be important for this. I have a problem verifying any request since the code isn't mine, so please only answer if you have a good suggestion regarding this topic.

I.E How can he get the client area of the tab control to accept drops?

/ Andreas
0
Comment
Question by:cost
  • 2
3 Comments
 
LVL 5

Expert Comment

by:vachooho
ID: 2629183
probably there is other window in tab ctrl's client area.

YOu need to register drop target for that window too!

0
 

Author Comment

by:cost
ID: 2631441
That I already understood, but since I can't find a way to get to that window I don't know what to do. I suggested to my friend to use CWnd::GetWindow(GW_CHILD), but he says it doesn't work
0
 
LVL 5

Accepted Solution

by:
vachooho earned 300 total points
ID: 2631667
try
CRect rect;
CTabCtrl::GetWindowRect(&rect);
CTabCtrl::AdjustRect(FALSE, &rect);
CPoint point(rect.left, rect.top);
point.Offset(rect.Width()/2, rect.Height()/2);
Wndn * pChild = CWnd::WindowFromPoint(point);
if(pChild != NULL)
{
   //register it as drop target
}

0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now