using System; namespace SystemTrayMenu.Helper { internal static class ShellHelper { #region Low/High Word /// /// Retrieves the High Word of a WParam of a WindowMessage /// /// The pointer to the WParam /// The unsigned integer for the High Word public static uint HiWord(IntPtr ptr) { uint param32 = (uint)(ptr.ToInt64() | 0xffffffffL); if ((param32 & 0x80000000) == 0x80000000) { return (param32 >> 16); } else { return (param32 >> 16) & 0xffff; } } /// /// Retrieves the Low Word of a WParam of a WindowMessage /// /// The pointer to the WParam /// The unsigned integer for the Low Word public static uint LoWord(IntPtr ptr) { uint param32 = (uint)(ptr.ToInt64() | 0xffffffffL); return (param32 & 0xffff); } #endregion } }