From e847b84d45370adc8082b570ac368cedf3ac9ce8 Mon Sep 17 00:00:00 2001 From: Paul Werelds Date: Mon, 4 Oct 2010 17:34:58 +0000 Subject: [PATCH] Cleaned the macros up a bit. --- GUI/GadgetWindow.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/GUI/GadgetWindow.cs b/GUI/GadgetWindow.cs index 4b71e66..aeb1f6f 100644 --- a/GUI/GadgetWindow.cs +++ b/GUI/GadgetWindow.cs @@ -427,20 +427,20 @@ namespace OpenHardwareMonitor.GUI { /// Some macros imported and converted from the Windows SDK /// private static class Macros { - public static UInt16 LOWORD(IntPtr l) { - return ((UInt16) (((UInt64) (l)) & 0xffff)); + public static ushort LOWORD(IntPtr l) { + return (ushort) ((ulong)l & 0xFFFF); } public static UInt16 HIWORD(IntPtr l) { - return ((UInt16) ((((UInt64) (l)) >> 16) & 0xffff)); + return (ushort) (((ulong)l >> 16) & 0xFFFF); } public static int GET_X_LPARAM(IntPtr lp) { - return ((int) (short) LOWORD(lp)); + return (short) LOWORD(lp); } public static int GET_Y_LPARAM(IntPtr lp) { - return ((int) (short) HIWORD(lp)); + return (short) HIWORD(lp); } }