home *** CD-ROM | disk | FTP | other *** search
Java Source | 1999-03-17 | 2.5 KB | 82 lines |
- // (C) Copyright 1995 - 1999 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 or later.
-
- 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);
- }
-
- // returns encoded CommCtrl version (lower 2 bytes are minor
- // version, upper 2 bytes are major).
- // returns 0 on failure.
- private static native int getSystemCommCtrlVersion();
-
- /**
- * Contains the installed version of comctl32.dll, which can be used
- * to determine the installed version of Internet Explorer.
- * Some Win32 "constants" have values dependent on the installed version
- * of Internet Explorer.
- * The lower 2 bytes are the minor version, the upper 2 bytes the major.
- */
- public static final int systemCommCtrlVersion = getSystemCommCtrlVersion();
-
- /**
- * Constants used to determine installed version of Internet Explorer, for
- * use with systemCommCtrlVersion.
- */
- public static final int WIN32_IE200 = 0x00040000; // base win95/NT4
- public static final int WIN32_IE300 = 0x00040046; // IE3.x
- public static final int WIN32_IE400 = 0x00040047; // IE4
- public static final int WIN32_IE401 = 0x00040048; // IE4.01
- }
-