123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- using System;
- namespace Microsoft.Win32
- {
-
-
-
- public static partial class Util
- {
-
-
-
-
-
- public static int GET_X_LPARAM(IntPtr lParam)
- {
- return LOWORD(lParam);
- }
-
-
-
-
-
- public static int GET_Y_LPARAM(IntPtr lParam)
- {
- return HIWORD(lParam);
- }
-
-
-
-
-
- public static byte HIBYTE(ushort wValue)
- {
- return (byte)((wValue >> 0x8) & 0xff);
- }
-
-
-
-
-
- public static byte LOBYTE(ushort wValue)
- {
- return (byte)(wValue & 0xff);
- }
-
-
-
-
-
- public static ushort HIWORD(uint dwValue)
- {
- return (ushort)((dwValue >> 0x10) & 0xffff);
- }
-
-
-
-
-
- public static ushort LOWORD(uint dwValue)
- {
- return (ushort)(dwValue & 0xffff);
- }
-
-
-
-
-
-
- public static ushort MAKEWORD(byte bLow, byte bHigh)
- {
- return (ushort)((((ushort)bHigh) << 0x8) | ((ushort)(bLow & 0xff)));
- }
-
-
-
-
-
-
- public static uint MAKELONG(ushort wLow, ushort wHigh)
- {
- return ((((uint)wHigh) << 0x10) | ((uint)(wLow & 0xffff)));
- }
-
-
-
-
-
-
- public static int MAKELPARAM(ushort wLow, ushort wHigh)
- {
- return (int)MAKELONG(wLow, wHigh);
- }
-
-
-
-
-
-
- public static int MAKEWPARAM(ushort wLow, ushort wHigh)
- {
- return (int)MAKELONG(wLow, wHigh);
- }
-
-
-
-
-
-
- public static IntPtr MAKELRESULT(ushort wLow, ushort wHigh)
- {
- return (IntPtr)MAKELONG(wLow, wHigh);
- }
-
-
-
-
-
- public static int HIWORD(int n)
- {
- return ((n >> 0x10) & 0xffff);
- }
-
-
-
-
-
- public static int HIWORD(IntPtr n)
- {
- return HIWORD((int)((long)n));
- }
-
-
-
-
-
- public static int LOWORD(int n)
- {
- return (n & 0xffff);
- }
-
-
-
-
-
- public static int LOWORD(IntPtr n)
- {
- return LOWORD((int)((long)n));
- }
-
-
-
-
-
- public static int SignedHIWORD(int n)
- {
- return (short)((n >> 0x10) & 0xffff);
- }
-
-
-
-
-
- public static int SignedHIWORD(IntPtr n)
- {
- return SignedHIWORD((int)((long)n));
- }
-
-
-
-
-
- public static int SignedLOWORD(int n)
- {
- return (short)(n & 0xffff);
- }
-
-
-
-
-
- public static int SignedLOWORD(IntPtr n)
- {
- return SignedLOWORD((int)((long)n));
- }
-
-
-
-
-
-
- public static int MAKELONG(int low, int high)
- {
- return ((high << 0x10) | (low & 0xffff));
- }
-
-
-
-
-
-
- public static IntPtr MAKELPARAM(int low, int high)
- {
- return (IntPtr)((high << 0x10) | (low & 0xffff));
- }
- }
- }
|