-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCTrackWnd.cpp
More file actions
59 lines (43 loc) · 1.17 KB
/
CTrackWnd.cpp
File metadata and controls
59 lines (43 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "pch.h"
#include "CTrackWnd.h"
BEGIN_MESSAGE_MAP(CTrackWnd, CWnd)
ON_WM_MOUSEMOVE()
ON_WM_CREATE()
ON_WM_MOUSELEAVE()
END_MESSAGE_MAP()
void CTrackWnd::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (!m_bTrack) {
TRACKMOUSEEVENT tme = { 0 };
tme.cbSize = sizeof(tme);
tme.dwFlags = TME_LEAVE;
tme.hwndTrack = m_hWnd;
tme.dwHoverTime = 0;
m_bTrack = ::_TrackMouseEvent(&tme);
if(m_bTrack)
SetWindowText(_T("Tracking"));
CString ls_str = _T("");
ls_str = _T("¡Ø¡Û¡Ø¡Û¡Ø¡Û CTrackWnd-OnMouseMove TrackMouseEvent On\n");
OutputDebugStringW(ls_str);
}
CWnd::OnMouseMove(nFlags, point);
}
int CTrackWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
m_bTrack = false;
return 0;
}
void CTrackWnd::OnMouseLeave()
{
// TODO: Add your message handler code here and/or call default
SetWindowText(_T("Track Test"));
m_bTrack = false;
CString ls_str = _T("");
ls_str = _T("¡Ø¡Û¡Ø¡Û¡Ø¡Û CTrackWnd-OnMouseLeave TrackMouseEvent Off\n");
OutputDebugStringW(ls_str);
CWnd::OnMouseLeave();
}