Line | |
---|
1 | using System;
|
---|
2 | using System.Windows;
|
---|
3 |
|
---|
4 | namespace Microsoft.Research.DynamicDataDisplay.Navigation
|
---|
5 | {
|
---|
6 | /// <summary>Helper class to parse Windows messages</summary>
|
---|
7 | internal static class MessagesHelper {
|
---|
8 | internal static int GetXFromLParam(IntPtr lParam) {
|
---|
9 | return LOWORD(lParam.ToInt32());
|
---|
10 | }
|
---|
11 |
|
---|
12 | internal static int GetYFromLParam(IntPtr lParam) {
|
---|
13 | return HIWORD(lParam.ToInt32());
|
---|
14 | }
|
---|
15 |
|
---|
16 | internal static Point GetMousePosFromLParam(IntPtr lParam) {
|
---|
17 | return new Point(GetXFromLParam(lParam), GetYFromLParam(lParam));
|
---|
18 | }
|
---|
19 |
|
---|
20 | internal static int GetWheelDataFromWParam(IntPtr wParam) {
|
---|
21 | return HIWORD(wParam.ToInt32());
|
---|
22 | }
|
---|
23 |
|
---|
24 | internal static short HIWORD(int i) {
|
---|
25 | return (short)((i & 0xFFFF0000) >> 16);
|
---|
26 | }
|
---|
27 |
|
---|
28 | internal static short LOWORD(int i) {
|
---|
29 | return (short)(i & 0x0000FFFF);
|
---|
30 | }
|
---|
31 | }
|
---|
32 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.