Click here to Skip to main content
       

C / C++ / MFC

 
GeneralRe: SOLVED Dbt.h - symbol not defined? PinmemberVaclav_Sal6-Dec-12 4:28 
GeneralRe: SOLVED Dbt.h - symbol not defined? PinmemberJochen Arndt6-Dec-12 4:50 
GeneralRe: SOLVED Dbt.h - symbol not defined? PinmemberVaclav_Sal7-Dec-12 8:26 
QuestionImage Processing Algorithms. Pinmembermbatra315-Dec-12 1:11 
AnswerRe: Image Processing Algorithms. PinmemberThatsAlok5-Dec-12 2:28 
AnswerRe: Image Processing Algorithms. PinmemberStefan_Lang6-Dec-12 3:43 
AnswerRe: Image Processing Algorithms. [modified] PinmemberApril Fans22-Dec-12 22:01 
QuestionMouse procedure On Multiple Window Pinmemberyogeshs4-Dec-12 19:20 
Hello friends
 
MFC application in which I m creating two Ruler bar which contains different color are object of same class rulerWnd. Now, am handling Mouse procedure on rulerWnd[lButtondown,up,mouseMove] are working Fine If i used to drag and drop some color to same ruler bar.
 
But If i have to drag some color from one ruler bar to another then it is dropping on same ruler. when i drop on other ruler from first then I checked on LbuttonUp that Point values are coming in negative and its dropping on same ruler even if my mouse LButton ups on another.
 
How can i handle two Windows mouse procedure at same time.
Any Ideas?
here is sample code that I am trying.
OnLButtonDown(UINT nFlags, CPoint point)
{
case SELECT_COPY:
{
  if(m_dwStyle == ruler1|| m_dwStyle == ruler2)
	{
	  GetWindowRect(&rect);
	  ClipCursor(NULL);
	  SetCapture();
	  if(m_szSelectIndexRange.cx>-1 && m_szSelectIndexRange.cy>-1)//When dragging,checking if mouse clicked on selected region
	  {
		int nSelIndex;
	        if(m_dwStyle == ruler1)
		{
			nSelIndex = point.x + m_lScrollPos;
			nSelIndex /= fWarpUnit;
		}
		else
		{
			nSelIndex = m_nSize-(rect.Height()-point.y)-m_lScrollPos;
			nSelIndex /= fWeftUnit;
			}
		if(nSelIndex >= m_szSelectIndexRange.cx && nSelIndex <=     m_szSelectIndexRange.cy)
		{
			m_bSelectDrag = TRUE;
			::SetCursor(AfxGetApp()->LoadCursor(IDC_DRAG_CURSOR));
		}
				}
			}
		}; break;
}
 

 
OnMouseMove(UINT nFlags, CPoint point)
 
case SELECT_COPY:
{
   if(m_bSelectDrag)
   {
	CRect rectWnd, invalidRect;
	GetClientRect(&rectWnd);
	if(m_dwStyle == ruler2)
	{
 	m_lPaintEndPos = point.y;//m_nSize-(rectWnd.Height()-point.y)-m_lScrollPos;
					invalidRect = CRect(0, point.y-50-  (m_szSelectIndexRange.cy-m_szSelectIndexRange.cx)*m_fStep*pDoc->GetZoomValue(), 22, \
						point.y +50);
	}
	else
	{
		m_lPaintEndPos = point.x + m_lScrollPos;
		invalidRect = CRect(m_lPaintEndPos-50, 0, \
		m_lPaintEndPos+50+(m_szSelectIndexRange.cy-m_szSelectIndexRange.cx)*m_fStep*pDoc->GetZoomValue(),	22);
	}
	InvalidateRect(&invalidRect, FALSE);
}
  else	SelectStripe(point);
}; break;
 
OnLButtonUP(UINT nFlags, CPoint point)
case SELECT_COPY:
 ClipCursor(NULL);
 if(m_bSelectDrag)
 {
	CopyStripe(point);
	m_bSelectDrag = FALSE;
 }
 else	SelectStripe(point);
break;

AnswerRe: Mouse procedure On Multiple Window [ setCapture Not Releasing] how to deal with two Windows. Pinmemberyogeshs4-Dec-12 21:00 
QuestionAbout set share directory Pinmembertida014-Dec-12 17:06 
QuestionHow to create a DLL for mini2440 to run Labview Application [modified] Pinmembersunil8800894-Dec-12 5:00 
AnswerRe: How to create a DLL for mini2440 to run Labview Application PinmvpRichard MacCutchan4-Dec-12 5:36 
GeneralRe: How to create a DLL for mini2440 to run Labview Application Pinmembersunil8800894-Dec-12 20:46 
GeneralRe: How to create a DLL for mini2440 to run Labview Application PinmvpRichard MacCutchan4-Dec-12 22:17 
QuestionCComboBox for lots and lots of options PinmemberMattias G4-Dec-12 4:09 
AnswerRe: CComboBox for lots and lots of options PinmvpRichard MacCutchan4-Dec-12 5:40 
GeneralRe: CComboBox for lots and lots of options PinmemberMattias G4-Dec-12 10:56 
GeneralRe: CComboBox for lots and lots of options PinmvpRichard MacCutchan4-Dec-12 22:15 
GeneralRe: CComboBox for lots and lots of options PinmemberRolf Kristensen5-Dec-12 8:13 
QuestionCString assignment crashes on Windows 7 [modified] Pinmemberpandit843-Dec-12 4:57 
SuggestionRe: CString assignment crashes on Windows 7 PinmemberDavidCrow3-Dec-12 5:08 
AnswerRe: CString assignment crashes on Windows 7 PinmvpCPallini3-Dec-12 5:15 
AnswerRe: CString assignment crashes on Windows 7 PinmvpRichard MacCutchan3-Dec-12 6:02 
GeneralRe: CString assignment crashes on Windows 7 Pinmemberpandit843-Dec-12 6:41 
GeneralRe: CString assignment crashes on Windows 7 PinmvpRichard MacCutchan3-Dec-12 7:22 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 26 Nov 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid