void CXTPSkinObjectTab::OnMouseMove(UINT /*nFlags*/, CPoint point)
{
	int nHotItem = -1;
	CTabCtrl* pTabCtrl = (CTabCtrl*)this;

	for (int iItem = 0; iItem < pTabCtrl->GetItemCount(); ++iItem)
	{
		CRect rcItem;
		pTabCtrl->GetItemRect(iItem, &rcItem);
		if (rcItem.PtInRect(point))
		{
			nHotItem = iItem;
			break;
		}
	}

	if (nHotItem != m_nHotItem)
	{
		m_nHotItem = nHotItem;
		InvalidateRect(GetHeaderRect(), FALSE);

		if (m_nHotItem != -1)
		{
			TRACKMOUSEEVENT tme = {sizeof(TRACKMOUSEEVENT), TME_LEAVE, m_hWnd, HOVER_DEFAULT};
			_TrackMouseEvent(&tme);
		}
	}
}
Exemple #2
0
void CBSObject::OnMouseMove(UINT nFlags, CPoint point)
{
    if (!m_bIsEnable)
    {
       
        return;
    }
    if (!m_bIsSelect )
	{
       
		if (!m_isHover)
		{			

          
			m_isHover = TRUE;

            if (m_isHoverEnabled)
            {
                
                PaintParent();
			    Invalidate();
            }
		}
	}

    if (!m_bIsSelect && m_isHover && GetCapture() != this)
    {

        TRACKMOUSEEVENT TrackMouseEvent;
		TrackMouseEvent.cbSize = sizeof (TRACKMOUSEEVENT);
		TrackMouseEvent.dwFlags = TME_LEAVE;
		TrackMouseEvent.hwndTrack = GetSafeHwnd();
		TrackMouseEvent.dwHoverTime = 0;
		_TrackMouseEvent(&TrackMouseEvent);

    }
    else if (!m_bIsSelect && m_isHover)
    {
        CRect rt;
        GetWindowRect(&rt);
        ScreenToClient(&rt);

        if (!rt.PtInRect(point))
        {
            TRACKMOUSEEVENT TrackMouseEvent;
		    TrackMouseEvent.cbSize = sizeof (TRACKMOUSEEVENT);
		    TrackMouseEvent.dwFlags = TME_LEAVE;
		    TrackMouseEvent.hwndTrack = GetSafeHwnd();
		    TrackMouseEvent.dwHoverTime = 0;
		    _TrackMouseEvent(&TrackMouseEvent);
        }
        
    }

    CWnd::OnMouseMove(nFlags, point);
}
Exemple #3
0
//########################################################################
// Sets TrackMouseEvent subclassing to all the buttons children of the specified window
//########################################################################
BOOL TME(HWND hwnd)
{
	treMouse_minimize.cbSize		= sizeof(TRACKMOUSEEVENT);
	treMouse_minimize.hwndTrack		= hwndMinimize;
	treMouse_minimize.dwFlags		= TME_HOVER | TME_LEAVE ;
	treMouse_minimize.dwHoverTime	= 10000;
	_TrackMouseEvent(&treMouse_minimize);
#include "push_gwlp.h"
	btnOld_minimize = (WNDPROC)SetWindowLongPtr(hwndMinimize, GWLP_WNDPROC, (LONG_PTR)minimizeButtonSubclassProc);
#include "pop_gwlp.h"



	treMouse_close.cbSize	= sizeof(TRACKMOUSEEVENT);
	treMouse_close.hwndTrack	= hwndClose;
	treMouse_close.dwFlags	= TME_HOVER | TME_LEAVE ;
	treMouse_close.dwHoverTime	= 10000;
	_TrackMouseEvent(&treMouse_close);
#include "push_gwlp.h"
	btnOld_close = (WNDPROC)SetWindowLongPtr(hwndClose, GWLP_WNDPROC, (LONG_PTR)closeButtonSubclassProc);
#include "pop_gwlp.h"



	treMouse_StartGame.cbSize		= sizeof(TRACKMOUSEEVENT);
	treMouse_StartGame.hwndTrack	= hwndStartGame;
	treMouse_StartGame.dwFlags		= TME_HOVER | TME_LEAVE ;
	treMouse_StartGame.dwHoverTime	= 10000;
	_TrackMouseEvent(&treMouse_StartGame);
#include "push_gwlp.h"
	btnOld_StartGame = (WNDPROC)SetWindowLongPtr(hwndStartGame, GWLP_WNDPROC, (LONG_PTR)StartGameButtonSubclassProc);
#include "pop_gwlp.h"

	treMouse_Register.cbSize		= sizeof(TRACKMOUSEEVENT);
	treMouse_Register.hwndTrack		= hwndRegister;
	treMouse_Register.dwFlags		= TME_HOVER | TME_LEAVE ;
	treMouse_Register.dwHoverTime	= 10000;
	_TrackMouseEvent(&treMouse_Register);
#include "push_gwlp.h"
	btnOld_Register = (WNDPROC)SetWindowLongPtr(hwndRegister, GWLP_WNDPROC, (LONG_PTR)RegisterButtonSubclassProc);
#include "pop_gwlp.h"

	treMouse_Cancel.cbSize		= sizeof(TRACKMOUSEEVENT);
	treMouse_Cancel.hwndTrack		= hwndCancel;
	treMouse_Cancel.dwFlags		= TME_HOVER | TME_LEAVE ;
	treMouse_Cancel.dwHoverTime	= 10000;
	_TrackMouseEvent(&treMouse_Cancel);
#include "push_gwlp.h"
	btnOld_Cancel = (WNDPROC)SetWindowLongPtr(hwndCancel, GWLP_WNDPROC, (LONG_PTR)CancelButtonSubclassProc);
#include "pop_gwlp.h"


	return TRUE;
}
Exemple #4
0
static void setMouseHwnd( HWND hwnd,int x,int y,BBObject *source ){
	if( hwnd==mouseHwnd ) return;

	if( hwnd && source ){
		BBRETAIN( source );
	}
	
	if( mouseHwnd ){
		POINT p;
		GetCursorPos( &p );
		ScreenToClient( mouseHwnd,&p );
		bbSystemEmitEvent( BBEVENT_MOUSELEAVE,mouseSource,0,0,p.x,p.y,&bbNullObject );
		if( mouseSource ){
			BBRELEASE( mouseSource );
		}
	}
	mouseHwnd=hwnd;
	updateMouseVisibility();
	if( mouseHwnd ){
		TRACKMOUSEEVENT tm={sizeof(tm),TME_LEAVE,hwnd,0};
		mouseSource=source;
		bbSystemEmitEvent( BBEVENT_MOUSEENTER,mouseSource,0,0,x,y,&bbNullObject );
		_TrackMouseEvent( &tm );
	}
}
Exemple #5
0
void CMainDlg::OnMouseMove(UINT nFlags, CPoint point)
{
	if (!m_bTracking)
	{
		TRACKMOUSEEVENT tme;
		tme.cbSize = sizeof(tme);
		tme.hwndTrack = m_hWnd;
		tme.dwFlags = TME_LEAVE;
		tme.dwHoverTime = 1;
		m_bTracking = (bool)_TrackMouseEvent(&tme);
	}
	if(DirectMouseEvent(WM_MOUSEMOVE,point.x,point.y)){ 
		CWnd::OnLButtonDown(nFlags, point);
		return;
	}else if(m_nHeight - point.y < 15 && m_nWidth - point.x < 5){ // 右下角
		SetWndCursor (m_hCursor_SizeNWSE);
		return;
	}else if(point.y>20 && m_nWidth - point.x < 5){ // 右边
		SetWndCursor (m_hCursor_SizeWE);
		return;
	}else{
		SetWndCursor (m_hCursor_Arrow);
		return;
	}

	CWnd::OnMouseMove(nFlags, point);
}
Exemple #6
0
void PngButton::OnMouseMove(UINT nFlags, CPoint point)
{
    // TODO: 在此添加消息处理程序代码和/或调用默认值
    if(!m_bOver)
    {
        TRACKMOUSEEVENT tme;
        tme.cbSize = sizeof(tme);
        tme.hwndTrack = m_hWnd;
        tme.dwFlags = TME_HOVER | TME_LEAVE;
        tme.dwHoverTime = 1;

        _TrackMouseEvent(&tme);
    }


    if (m_bHandCursor)
    {
        HCURSOR hCur = LoadCursor(NULL, IDC_HAND);
        ::SetCursor(hCur);
    } else
    {
        HCURSOR hCur = LoadCursor(NULL, IDC_ARROW);
        ::SetCursor(hCur);
    }

    CWnd::OnMouseMove(nFlags, point);
}
Exemple #7
0
void FW_DropDownWnd::OnMouseMove(UINT nFlags, CPoint point)
{
	if (m_buttonRect.PtInRect(point))
	{
		// Raise the button if it is not already.
		if (m_nDropDownState != 1)
		{
			m_nDropDownState = 1;
			Invalidate();

			// Start mouse tracking if it is not already running.
			if (!m_bMouseTracking)
			{
				TRACKMOUSEEVENT tme;
				memset(&tme, 0, sizeof(tme));
				tme.cbSize = sizeof(tme);
				tme.hwndTrack = GetSafeHwnd();
				tme.dwFlags = TME_LEAVE;
				if (_TrackMouseEvent(&tme))
					m_bMouseTracking = true;
			}
		}
	}

	// Reset the button if it is raised.
	else if (m_nDropDownState == 1)
	{
		m_nDropDownState = 0;
		Invalidate();
	}

	CWnd::OnMouseMove(nFlags, point);
}
Exemple #8
0
void CLogo::OnMouseMove(UINT nFlags, CPoint point) 
{	
	CBitmapButton::OnMouseMove(nFlags, point);

	TRACKMOUSEEVENT TrackMouseEventStructure;
	ZeroMemory(&TrackMouseEventStructure,sizeof(TrackMouseEventStructure));
	TrackMouseEventStructure.cbSize = sizeof(TrackMouseEventStructure);
	TrackMouseEventStructure.hwndTrack = m_hWnd;
	TrackMouseEventStructure.dwFlags = TME_LEAVE;
	TrackMouseEventStructure.dwHoverTime = HOVER_DEFAULT;

	_TrackMouseEvent(&TrackMouseEventStructure);

	if ((nFlags & MK_LBUTTON)!=0 ||
		(nFlags & MK_RBUTTON)!=0) 
	  return;
	
	CString MessageLine;
	if(MessageLine.LoadString(GetDlgCtrlID()))
	{
		int nDelPos = MessageLine.Find(_T('\n'));
		if(nDelPos != -1)
			MessageLine = MessageLine.Left(nDelPos);
	}

	CWnd*  pMainWnd = ::AfxGetMainWnd();
	if(pMainWnd)
		pMainWnd->SendMessage(WM_SETMESSAGESTRING,0,LPARAM(LPCTSTR(MessageLine)));
}
Exemple #9
0
////////////////////////////////////////////////////////////////////////////////
//
// FUNCTION:	  OnMouseMove
//
// DESCRIPTION:	Tracks mouse whilst pressed
//
//
// NOTES:
//
// MAINTENANCE:
// Name:		  Date:	  Version:	Notes:
// NT ALMOND	210100	1.0			  Origin
//
////////////////////////////////////////////////////////////////////////////////
void CCoolBtn::OnMouseMove(UINT nFlags, CPoint point)
{
    if (m_bPushed)
    {
        ClientToScreen(&point);

        if (WindowFromPoint(point) != this)
        {
            m_bPushed = FALSE;
            ReleaseCapture();
            Invalidate();
        }
    }
    if (!m_bTracking)
    {
        TRACKMOUSEEVENT tme;
        tme.cbSize = sizeof(tme);
        tme.hwndTrack = m_hWnd;
        tme.dwFlags = TME_LEAVE|TME_HOVER;
        tme.dwHoverTime = 1;
        m_bTracking = _TrackMouseEvent(&tme) != FALSE;
    }

    CButton::OnMouseMove(nFlags, point);
}
Exemple #10
0
void CEditWithButton_Base::OnNcMouseMove(UINT nHitTest, CPoint point)
{
	CRect rectWindow;
	GetWindowRect(rectWindow);
	CRect rectButton = GetButtonRect(rectWindow);

	bool OldState = m_IsButtonHot;
	m_IsButtonHot = rectButton.PtInRect(point) != FALSE;
	// If the button state has changed, redraw it to reflect the change
	if (OldState != m_IsButtonHot)
	{
		SetWindowPos(NULL, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER);

		// If the state has changed to hot, register to get the WM_NCMOUSELEAVE notification.
		if (m_IsButtonHot)
		{
			TRACKMOUSEEVENT tme;
			tme.cbSize = sizeof(tme);
			tme.dwFlags = TME_LEAVE | TME_NONCLIENT;
			tme.hwndTrack = m_hWnd;
			tme.dwHoverTime = HOVER_DEFAULT;
			_TrackMouseEvent(&tme);
		}
	}

	CEdit::OnNcMouseMove(nHitTest, point);
}
void CListViewCtrlEx::OnMouseMove(UINT nFlags, CPoint point)
{
    TRACKMOUSEEVENT trkMouse;
    trkMouse.cbSize = sizeof( TRACKMOUSEEVENT );
    trkMouse.dwFlags = TME_LEAVE;
    trkMouse.hwndTrack = m_hWnd;

    // notify when the mouse leaves button
    _TrackMouseEvent( &trkMouse );

    CRect	rcItem;

    LVHITTESTINFO hti;
    hti.pt = point;
    SubItemHitTest( &hti );

    if( m_nHoverItem != hti.iItem || m_nHoverSubItem != hti.iSubItem)
    {
        m_nHoverItem = hti.iItem;
        m_nHoverSubItem = hti.iSubItem;
        _FireEvent(WMH_LISTEX_HOVERCHANGED, m_nHoverItem);

        KillTimer(XX_TIMER_ID_TIPS);
        //CBkSafeTip::Hide();
    }

    static CPoint ptLast;
    if (ptLast != point && hti.iItem != -1)
        SetTimer(XX_TIMER_ID_TIPS, 200);

    ptLast = point;
}
Exemple #12
0
void CSkinButton2::OnMouseMove(UINT nFlags, CPoint point)
{
	if(m_bUseResponseRect && !m_rcResponse.PtInRect(point))
	{
		//CButton::OnMouseMove(nFlags, point);
		SendMouseMessageToParent(WM_MOUSEMOVE, nFlags, point);
		return;
	}
	if( !m_bSelected && IsWindowEnabled()&&m_bHandMouse )
	{
#ifndef IDC_HAND
#define IDC_HAND            MAKEINTRESOURCE(32649)
#endif
		::SetCursor(::LoadCursor(NULL, IDC_HAND));
	}

	if (!m_bMouseOnButton) 
	{ 
		TRACKMOUSEEVENT   tme; 
		tme.cbSize   =   sizeof(tme); 
		tme.hwndTrack   =   m_hWnd; 
		tme.dwFlags   =   TME_LEAVE   |   TME_HOVER; 
		tme.dwHoverTime   =   1; 
		m_bMouseOnButton   =   _TrackMouseEvent(&tme); 
	} 
	CButton::OnMouseMove(nFlags, point);
}
LRESULT CLrcMask::OnNCMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	if (!m_bTrace)
	{
		TRACKMOUSEEVENT tme;
		tme.cbSize = sizeof(tme);
		tme.hwndTrack = this->m_hWnd;
		tme.dwFlags = TME_LEAVE|TME_NONCLIENT;
		tme.dwHoverTime = 10;
		m_bTrace = _TrackMouseEvent(&tme)==0 ? false : true;
	}	
	DuiLib::CDuiRect rect;
	GetWindowRect(&rect);
	DuiLib::CPoint point = DuiLib::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
	RECT sizebox;
	sizebox = GetPaintMgr()->GetSizeBox();
	rect.left+= sizebox.left;
	rect.top+=sizebox.top;
	rect.right-=sizebox.right;
	rect.bottom-=sizebox.bottom;
	if (::PtInRect(&rect,point))
	{
		SetCursor(LoadCursor(NULL,MAKEINTRESOURCE(32651)));
	}
	
	m_bMouseOn = true;
//	bHandled = false;
	
	YTrace_(m_bMouseOn?_T("CLrcMask::OnMouseMove:m_bMouseOn=true"):_T("CLrcMask::OnMouseMove:m_bMouseOn=false"));
	return 0;
}
Exemple #14
0
void CExpensiveGiftCtrl::OnMouseMove(UINT nFlags, CPoint point) 
{ 
	if ( !m_bTrackLeave) {
		//Track the mouse leave event
		TRACKMOUSEEVENT tme;
		tme.cbSize = sizeof(tme);
		tme.hwndTrack = GetSafeHwnd();
		tme.dwFlags = TME_LEAVE;
		_TrackMouseEvent(&tme);
		m_bTrackLeave = true;

		if (m_toolTip.m_hWnd == NULL)
		{
			m_toolTip.Create(this, TTS_ALWAYSTIP);
			m_toolTip.AddTool(this, sNowInfo);
			m_toolTip.SetMaxTipWidth(1000);
			//m_toolTip.Activate(FALSE);
		}
		else
		m_toolTip.UpdateTipText(sNowInfo,this);
		//::PostMessage(GetParent()->GetSafeHwnd(),WM_SCROLL_TIP,1,(LPARAM)(LPCTSTR)sNowInfo);

	}
	
	CWnd::OnMouseMove(nFlags, point);
}
Exemple #15
0
void CCherryComboBox::OnMouseLeave()
{
	COMBOBOXINFO comboBoxInfo = { sizeof(COMBOBOXINFO) };
	GetComboBoxInfo(&comboBoxInfo);

	// 버튼이 눌린 상태면
	if (/* comboBoxInfo.stateButton == STATE_SYSTEM_PRESSED || */ !m_bDropDown)
	{
		// Normal
		m_pCurrentImage = &m_images[STATUS_NORMAL];
	}

	if (m_bTracking)
	{
		TRACKMOUSEEVENT trackMouseEvent;
		trackMouseEvent.cbSize = sizeof(TRACKMOUSEEVENT);
		trackMouseEvent.dwFlags = TME_CANCEL;
		trackMouseEvent.hwndTrack = GetSafeHwnd();
		trackMouseEvent.dwHoverTime = 1;
		_TrackMouseEvent(&trackMouseEvent);

		m_bTracking = FALSE;
	}

	m_bHover = FALSE;
	SetCurrentFont(GetNormalFont());

	if (m_bEnableHoverHandCursor)
		SetClassLong(GetSafeHwnd(), GCL_HCURSOR, (LONG)AfxGetApp()->LoadStandardCursor(IDC_ARROW));

	Invalidate(FALSE);

	CComboBox::OnMouseLeave();
}
Exemple #16
0
void CLocatorBar::OnMouseMove(UINT nFlags, CPoint point)
{
	m_MousePos = point;
	if (!m_bMouseWithin)
	{
		m_bMouseWithin = TRUE;
		TRACKMOUSEEVENT tme;
		tme.cbSize = sizeof(TRACKMOUSEEVENT);
		tme.dwFlags = TME_LEAVE;
		tme.hwndTrack = m_hWnd;
		_TrackMouseEvent(&tme);
	}

	if (nFlags & MK_LBUTTON)
	{
		CRect rect;
		GetClientRect(rect);
		int nLine = point.y*m_nLines/rect.Height();

		if (nLine < 0)
			nLine = 0;
		if ((m_pMainFrm)&&(m_pMainFrm->m_pwndBottomView))
			m_pMainFrm->m_pwndBottomView->GoToLine(nLine, FALSE);
		if ((m_pMainFrm)&&(m_pMainFrm->m_pwndLeftView))
			m_pMainFrm->m_pwndLeftView->GoToLine(nLine, FALSE);
		if ((m_pMainFrm)&&(m_pMainFrm->m_pwndRightView))
			m_pMainFrm->m_pwndRightView->GoToLine(nLine, FALSE);
	}
	Invalidate();
}
Exemple #17
0
void CMyBtn::OnMouseMove(UINT nFlags, CPoint point) 
{
    BOOL OldFlag = bTrackLeave;
	if (!bTrackLeave)
	{

       // 鼠标第一次移入窗口时, 请求一个WM_MOUSELEAVE 消息
      
        TRACKMOUSEEVENT tme;

        tme.cbSize = sizeof(tme);

        tme.hwndTrack = m_hWnd;

        tme.dwFlags = TME_LEAVE;

        _TrackMouseEvent(&tme);

        bTrackLeave = TRUE;
        // 在这里添加处理鼠标进入的代码 :

    }

    if(OldFlag != bTrackLeave)
	{
		this->Invalidate(FALSE);
	}
	CWnd::OnMouseMove(nFlags, point);
}
Exemple #18
0
BOOL CSkinScrollBar::StartTrackMouseLeave()
{
	TRACKMOUSEEVENT tme = { 0 };
	tme.cbSize = sizeof(tme);
	tme.dwFlags = TME_LEAVE;
	tme.hwndTrack = m_hOwnerWnd;
	return _TrackMouseEvent(&tme);
}
void FSplitterWindow::StartMouseTrack()
{
    TRACKMOUSEEVENT tme = { 0 };
    tme.cbSize = sizeof(tme);
    tme.dwFlags = TME_LEAVE;
    tme.hwndTrack = m_hWnd;
    _TrackMouseEvent(&tme);
}
Exemple #20
0
BOOL CFaceCtrl::StartTrackMouseLeave()
{
	TRACKMOUSEEVENT tme = { 0 };
	tme.cbSize = sizeof(tme);
	tme.dwFlags = TME_LEAVE;
	tme.hwndTrack = m_hWnd;
	return _TrackMouseEvent(&tme);
}
BOOL CPopupFrame::StartTrackMouseHover()
{
	TRACKMOUSEEVENT tme = { 0 };
	tme.cbSize = sizeof(tme);
	tme.dwFlags = TME_LEAVE | /*TME_HOVER | */0x00000010;
	tme.hwndTrack = m_hWnd;
	return _TrackMouseEvent(&tme);
}
Exemple #22
0
void CSkinDialog::OnNcMouseMove(CPoint point)
{
   	//获取窗体DC
	CWindowDC WndDc(this);
	//创建Graphics对象
	Graphics graph(WndDc.m_hDC);
	
	//设定鼠标进入标题栏
	if(!m_bMouseInTitileBar){
		TRACKMOUSEEVENT tme;
		tme.cbSize		= sizeof(tme);
		tme.hwndTrack	= m_hWnd;
		tme.dwFlags		= TME_LEAVE|TME_HOVER|TME_NONCLIENT;
		_TrackMouseEvent(&tme);  
		m_bMouseInTitileBar = true;
	}

	CRect rtButton;	
	CRect rtWnd;
	this->GetWindowRect(&rtWnd);

	//绘制退出按钮
	rtButton = m_rtBtnExt;
	rtButton.OffsetRect(rtWnd.left, rtWnd.top);
	if(rtButton.PtInRect(point)){	
		graph.DrawImage(m_bpBtnExtFocus,m_rtBtnExt.left,m_rtBtnExt.top,m_bpBtnExtFocus->GetWidth(),m_bpBtnExtFocus->GetHeight());
	}else{
		graph.DrawImage(m_bpBtnExt,m_rtBtnExt.left,m_rtBtnExt.top,m_bpBtnExt->GetWidth(),m_bpBtnExt->GetHeight());
	}

	//绘制最大化/恢复按钮
	rtButton = m_rtBtnMax;
	rtButton.OffsetRect(rtWnd.left, rtWnd.top);
	if(rtButton.PtInRect(point)){
		if(this->IsZoomed()){
			graph.DrawImage(m_bpBtnResFocus,m_rtBtnMax.left,m_rtBtnMax.top,m_bpBtnResFocus->GetWidth(),m_bpBtnResFocus->GetHeight());
		}else{
			graph.DrawImage(m_bpBtnMaxFocus,m_rtBtnMax.left,m_rtBtnMax.top,m_bpBtnMaxFocus->GetWidth(),m_bpBtnMaxFocus->GetHeight());
		}
	}else{
		if(this->IsZoomed()){
			graph.DrawImage(m_bpBtnRes,m_rtBtnMax.left,m_rtBtnMax.top,m_bpBtnRes->GetWidth(),m_bpBtnRes->GetHeight());
		}else{
			graph.DrawImage(m_bpBtnMax,m_rtBtnMax.left,m_rtBtnMax.top,m_bpBtnMax->GetWidth(),m_bpBtnMax->GetHeight());
		}
	}

	//绘制最小化按钮
	rtButton = m_rtBtnMin;
	rtButton.OffsetRect(rtWnd.left, rtWnd.top);
	if(rtButton.PtInRect(point)){	
		graph.DrawImage(m_bpBtnMinFocus,m_rtBtnMin.left,m_rtBtnMin.top,m_bpBtnMinFocus->GetWidth(),m_bpBtnMinFocus->GetHeight());
	}else{
		graph.DrawImage(m_bpBtnMin,m_rtBtnMin.left,m_rtBtnMin.top,m_bpBtnMin->GetWidth(),m_bpBtnMin->GetHeight());
	}

	return;
}
BOOL CHapticMouse::CancelLeaveNotify()
{
    TRACKMOUSEEVENT tmev;
    tmev.cbSize = sizeof tmev;
    tmev.dwFlags = TME_CANCEL | TME_LEAVE;
    tmev.hwndTrack = GetSafeHwnd();
    tmev.dwHoverTime = HOVER_DEFAULT;

    return _TrackMouseEvent(&tmev);
}
Exemple #24
0
LRESULT CALLBACK AlphaTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	if (!IsWindowEnabled(hwnd))
		return mir_callNextSubclass(hwnd, AlphaTrackBarWndProc, msg, wParam, lParam);

	static int oldVal = -1;
	switch (msg) {
	case WM_MOUSEWHEEL:
	case WM_KEYDOWN:
	case WM_KEYUP:
		if (!IsWindowVisible(hwndBox))
			break;

	case WM_MOUSEMOVE:
		{
			TRACKMOUSEEVENT tme;
			tme.cbSize = sizeof(tme);
			tme.dwFlags = TME_LEAVE;
			tme.dwHoverTime = HOVER_DEFAULT;
			tme.hwndTrack = hwnd;
			_TrackMouseEvent(&tme);

			int newVal = (BYTE)SendMessage(hwnd, TBM_GETPOS, 0, 0);
			if (oldVal != newVal)
			{

				if (oldVal < 0)
				{
					SetWindowLongPtr(hwndBox, GWLP_USERDATA, 1);
					RECT rc; GetWindowRect(hwnd, &rc);
					SetWindowPos(hwndBox, NULL,
						(rc.left+rc.right-170)/2, rc.bottom+2, 170, 50,
						SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_SHOWWINDOW);
					SetWindowRgn(hwndBox, NULL, TRUE);
				}
				SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE) | WS_EX_LAYERED);
				SetLayeredWindowAttributes(hwndBox, NULL, newVal, LWA_ALPHA);

				oldVal = newVal;
			}
		}
		break;

	case WM_MOUSELEAVE:
		SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE) & ~WS_EX_LAYERED);
		SetLayeredWindowAttributes(hwndBox, NULL, 255, LWA_ALPHA);

		ShowWindow(hwndBox, SW_HIDE);
		oldVal = -1;
		break;
	}
	return mir_callNextSubclass(hwnd, AlphaTrackBarWndProc, msg, wParam, lParam);
}
Exemple #25
0
void CMyDialog::OnMouseMove(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	if (!m_bTracked)
	{
		TRACKMOUSEEVENT tme;
		tme.cbSize = sizeof(tme);
		tme.hwndTrack = m_hWnd;
		tme.dwFlags = TME_LEAVE;
		tme.dwHoverTime = 1;
		m_bTracked = _TrackMouseEvent(&tme);
		m_bTracked=TRUE;
	}
	if (point.y<=30)
	{
		if (m_rcClose.PtInRect(point))
		{
			if (!m_bCloseHover)
			{
				m_bCloseHover=TRUE;
				DrawCloseButton(GetDC(),DTS_HOVER);
				m_bMinHover=FALSE;
				DrawMinButton(GetDC(),DTS_NORMAL);
			}
		}
		else if (m_rcMin.PtInRect(point))
		{
			if (!m_bMinHover)
			{
				m_bMinHover=TRUE;
				DrawMinButton(GetDC(),DTS_HOVER);
				m_bCloseHover=FALSE;
				DrawCloseButton(GetDC(),DTS_NORMAL);
			}
		}
		else
		{
			if (m_bCloseHover)
			{
				m_bCloseHover=FALSE;
				DrawCloseButton(GetDC(),DTS_NORMAL);
			}
			if (m_bMinHover)
			{
				m_bMinHover=FALSE;
				DrawMinButton(GetDC(),DTS_NORMAL);
			}
		}
	}

	CDialog::OnMouseMove(nFlags, point);
}
void CIconButton::OnMouseMove(UINT nFlags, CPoint point)
{
	if (!m_bTracking)
	{
		TRACKMOUSEEVENT tme;
		tme.cbSize = sizeof(tme);
		tme.hwndTrack = m_hWnd;
		tme.dwFlags = TME_LEAVE | TME_HOVER;
		tme.dwHoverTime = 1;
		m_bTracking = _TrackMouseEvent(&tme);
	}
	CButton::OnMouseMove(nFlags, point);
}
Exemple #27
0
void CFastSplitter::OnMouseMove(UINT nFlags, CPoint point) 
{

	if (m_mode == MOD_Normal)
	{
		if (m_bDragging || m_SplitterRect.PtInRect(point))
		{
			::SetCursor( AfxGetApp()->LoadStandardCursor(LPCTSTR (m_bVertSplitter ? IDC_SIZEWE : IDC_SIZENS)));
			if (m_bDragging)
			{
				if (m_bLiveUpdate)
				{
					if (m_bVertSplitter)
						m_SplitterPos = m_BarPos + point.x - m_DragStartPoint.x;
					else
						m_SplitterPos = m_BarPos + point.y - m_DragStartPoint.y;
					MovePanes();
				}
				else
				{
					if (m_bVertSplitter)
						m_BarPos = m_RealSplitterPos + point.x - m_DragStartPoint.x;
					else
						m_BarPos = m_RealSplitterPos + point.y - m_DragStartPoint.y;
					DrawBar();	
				}
			}
			else if (!m_bTracking)
			{
				//TRACE(_T("CFastSplitter::OnMouseMove !m_bTracking\r\n"));
				TRACKMOUSEEVENT tme;
				tme.cbSize = sizeof(tme);
				tme.hwndTrack = m_hWnd;
				tme.dwFlags = TME_LEAVE;
				tme.dwHoverTime = HOVER_DEFAULT;
				m_bTracking = _TrackMouseEvent(&tme);

				HWND hWnd = GetSafeHwnd();
				if ((hWnd != NULL) && ::IsWindow (hWnd))
					InvalidateRect(&m_SplitterRect);
			}
		}
		else
		{
			//TRACE(_T("CFastSplitter::OnMouseMove !m_bDragging !m_bTracking\r\n"));

		}
	}

	CWnd::OnMouseMove(nFlags, point);
}
Exemple #28
0
void CExEdit::OnMouseMove(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	TRACKMOUSEEVENT mouseEvent;

	mouseEvent.cbSize = sizeof( TRACKMOUSEEVENT );
	mouseEvent.dwFlags = TME_HOVER | TME_LEAVE;
	mouseEvent.dwHoverTime = 0;
	mouseEvent.hwndTrack = m_hWnd;

	_TrackMouseEvent( &mouseEvent );

	CEdit::OnMouseMove(nFlags, point);
}
Exemple #29
0
void CHyperlink::OnMouseMove(UINT nFlags, CPoint point) 
{
	if (!m_Hovering) {
		TRACKMOUSEEVENT	tme;
		memset(&tme, 0, sizeof(tme));
		tme.cbSize = sizeof(tme);
		tme.dwFlags = TME_LEAVE;
		tme.hwndTrack = m_hWnd;
		_TrackMouseEvent(&tme);	// request WM_MOUSELEAVE notification
		m_Hovering = TRUE;
		Invalidate();
	}
	CStatic::OnMouseMove(nFlags, point);
}
void CTransButton::OnMouseMove(UINT nFlags, CPoint point)
{
	if (!m_bTracking)
	{
		m_bOver = TRUE;
		TRACKMOUSEEVENT tme;
		tme.cbSize = sizeof(tme);
		tme.hwndTrack = m_hWnd;
		tme.dwFlags = TME_LEAVE | TME_HOVER;
		tme.dwHoverTime = 50;
		m_bTracking = (BOOL)_TrackMouseEvent(&tme);
	}
	CButton::OnMouseMove(nFlags, point);
}