home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-05 | 1.4 KB | 59 lines |
- // Copyright (C) 1998 Microsoft Corporation All Rights Reserved
-
- // These classes provide direct, low-overhead access to commonly used
- // Windows api. These classes use the new J/Direct feature.
- //
- // Information on how to use J/Direct to write your own declarations
- // can be found in the Microsoft SDK for Java 2.0.
-
- package com.ms.win32;
-
-
- /** @security(checkClassLinking=on) */
- public class Win32Lib
- {
- public static short MAKEWORD(int nLow, int nHigh)
- {
- // concatenate high bit of high byte, low 7 bits of high byte, and
- // low byte.
- return (short)((((nHigh & 0x80) != 0x0) ? 0xFFFF8000 : 0x0) |
- ((nHigh & 0x7F) << 8) |
- (nLow & 0xFF));
- }
-
- public static int MAKELONG(int nLow, int nHigh)
- {
- return (nHigh << 16) | (nLow & 0xFFFF);
- }
-
- public static int LOWORD(int n)
- {
- return n & 0xFFFF;
- }
-
- public static int HIWORD(int n)
- {
- return (n >> 16) & 0xFFFF;
- }
-
- public static int LOBYTE(int n)
- {
- return n & 0xFF;
- }
-
- public static int HIBYTE(int n)
- {
- return (n >> 8) & 0xFF;
- }
-
- public static int MAKEWPARAM(int nLow, int nHigh)
- {
- return (nHigh << 16) | (nLow & 0xFFFF);
- }
-
- public static int MAKELPARAM(int nLow, int nHigh)
- {
- return (nHigh << 16) | (nLow & 0xFFFF);
- }
- }
-