Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/Charts/Navigation/MessagesHelper.cs @ 12747

Last change on this file since 12747 was 12503, checked in by aballeit, 10 years ago

#2283 added GUI and charts; fixed MCTS

File size: 841 bytes
Line 
1using System;
2using System.Windows;
3
4namespace 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.