-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMouse.cpp
More file actions
45 lines (40 loc) · 859 Bytes
/
Copy pathMouse.cpp
File metadata and controls
45 lines (40 loc) · 859 Bytes
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
#include "Mouse.h"
#include "WinGraph.h"
POINT GetMousePosition(VOID)
{
POINT Point;
if (GetCursorPos(&Point) == FALSE)
return { 0, 0 };
return Point;
}
BOOL isMouseHover(HGRAPH hGraph)
{
POINT Point ;
if (GetCursorPos(&Point) == FALSE)
return FALSE;
RECT client;
HWND hwndGraph = NULL;
hwndGraph = GetGraphWnd(hGraph);
if (hwndGraph)
{
if (IsWindowVisible(hwndGraph))
{
if (GetWindowRect(hwndGraph, &client))
{
//printf("\t%i>%i--%i<%i--%i<%i--%i>%i--\n", Point.x, client.left, Point.x, client.right, Point.y, client.bottom, Point.y, client.top);
if (((Point.x > client.left) && (Point.x < client.right)) && ((Point.y < client.bottom) && (Point.y > client.top)))
{
//printf("Hoover\n");
return TRUE;
}
}
}
}
return FALSE;
}
VOID DisplayPointer(HGRAPH hGraph)
{
if (isMouseHover(hGraph))
{
}
}