Solved

Drag/Drop on CTabCtrl?

Posted on 2000-03-17
3
637 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Whole sheet autoscrub still needed 19 48
MaxSpan challenge 9 79
Sed question 2 68
Making an alias 7 77
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

929 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

16 Experts available now in Live!

Get 1:1 Help Now