home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 14 / IOPROG_14.ISO / soft / sdkjava / sdkjava.exe / SDKJava.cab / Src / Win32Api / Win32Lib.java < prev    next >
Encoding:
Java Source  |  1998-03-05  |  1.4 KB  |  59 lines

  1. // Copyright (C) 1998 Microsoft Corporation  All Rights Reserved
  2.  
  3. // These classes provide direct, low-overhead access to commonly used
  4. // Windows api. These classes use the new J/Direct feature.
  5. //
  6. // Information on how to use J/Direct to write your own declarations
  7. // can be found in the Microsoft SDK for Java 2.0.
  8.  
  9. package com.ms.win32;
  10.  
  11.  
  12. /** @security(checkClassLinking=on) */
  13. public class Win32Lib
  14. {
  15.     public static short MAKEWORD(int nLow, int nHigh)
  16.     {
  17.         // concatenate high bit of high byte, low 7 bits of high byte, and
  18.         //  low byte.
  19.         return (short)((((nHigh & 0x80) != 0x0) ? 0xFFFF8000 : 0x0) |
  20.                                 ((nHigh & 0x7F) << 8) |
  21.                                 (nLow & 0xFF));
  22.     }
  23.  
  24.     public static int MAKELONG(int nLow, int nHigh)
  25.     {
  26.         return (nHigh << 16) | (nLow & 0xFFFF);
  27.     }
  28.  
  29.     public static int LOWORD(int n)
  30.     {
  31.         return n & 0xFFFF;
  32.     }
  33.  
  34.     public static int HIWORD(int n)
  35.     {
  36.         return (n >> 16) & 0xFFFF;
  37.     }
  38.  
  39.     public static int LOBYTE(int n)
  40.     {
  41.         return n & 0xFF;
  42.     }
  43.  
  44.     public static int HIBYTE(int n)
  45.     {
  46.         return (n >> 8) & 0xFF;
  47.     }
  48.  
  49.     public static int MAKEWPARAM(int nLow, int nHigh)
  50.     {
  51.         return (nHigh << 16) | (nLow & 0xFFFF);
  52.     }
  53.  
  54.     public static int MAKELPARAM(int nLow, int nHigh)
  55.     {
  56.         return (nHigh << 16) | (nLow & 0xFFFF);
  57.     }
  58. }
  59.