# HG changeset patch # User paulwerelds # Date 1286213698 0 # Node ID be7dc4a856aa6d5ebeefd920a426632e59ff46f9 # Parent dee42c887ab0f9adcc20226fc33ca022b4484576 Cleaned the macros up a bit. diff -r dee42c887ab0 -r be7dc4a856aa GUI/GadgetWindow.cs --- a/GUI/GadgetWindow.cs Mon Oct 04 16:56:42 2010 +0000 +++ b/GUI/GadgetWindow.cs Mon Oct 04 17:34:58 2010 +0000 @@ -427,20 +427,20 @@ /// 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); } }