Class DISPLAY_DEVICE

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer


    public class DISPLAY_DEVICE
    extends Struct
    Receives information about the display device specified by the iDevNum parameter of the User32.EnumDisplayDevices(java.nio.ByteBuffer, int, org.lwjgl.system.windows.DISPLAY_DEVICE, int) function.

    The four string members are set based on the parameters passed to EnumDisplayDevices. If the lpDevice param is NULL, then DISPLAY_DEVICE is filled in with information about the display adapter(s). If it is a valid device name, then it is filled in with information about the monitor(s) for that device.

    Member documentation

    • cb – size, in bytes, of the DISPLAY_DEVICE structure. This must be initialized prior to calling User32.EnumDisplayDevices(java.nio.ByteBuffer, int, org.lwjgl.system.windows.DISPLAY_DEVICE, int).
    • DeviceName – an array of characters identifying the device name. This is either the adapter device or the monitor device.
    • DeviceString – an array of characters containing the device context string. This is either a description of the display adapter or of the display monitor.
    • StateFlags – device state flags
    • DeviceID – not used
    • DeviceKey – reserved

    Layout

    struct DISPLAY_DEVICE {
        DWORD cb;
        TCHAR[32] DeviceName;
        TCHAR[128] DeviceString;
        DWORD StateFlags;
        TCHAR[128] DeviceID;
        TCHAR[128] DeviceKey;
    }
    • Field Detail

      • SIZEOF

        public static final int SIZEOF
        The struct size in bytes.
    • Constructor Detail

      • DISPLAY_DEVICE

        public DISPLAY_DEVICE(java.nio.ByteBuffer container)
        Creates a DISPLAY_DEVICE instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns the sizeof(struct).
        Specified by:
        sizeof in class Struct
      • cb

        public int cb()
        Returns the value of the cb field.
      • DeviceName

        public java.nio.ByteBuffer DeviceName()
        Returns a ByteBuffer view of the DeviceName field.
      • DeviceNameString

        public java.lang.String DeviceNameString()
        Decodes the null-terminated string stored in the DeviceName field.
      • DeviceString

        public java.nio.ByteBuffer DeviceString()
        Returns a ByteBuffer view of the DeviceString field.
      • DeviceStringString

        public java.lang.String DeviceStringString()
        Decodes the null-terminated string stored in the DeviceString field.
      • StateFlags

        public int StateFlags()
        Returns the value of the StateFlags field.
      • DeviceID

        public java.nio.ByteBuffer DeviceID()
        Returns a ByteBuffer view of the DeviceID field.
      • DeviceIDString

        public java.lang.String DeviceIDString()
        Decodes the null-terminated string stored in the DeviceID field.
      • DeviceKey

        public java.nio.ByteBuffer DeviceKey()
        Returns a ByteBuffer view of the DeviceKey field.
      • DeviceKeyString

        public java.lang.String DeviceKeyString()
        Decodes the null-terminated string stored in the DeviceKey field.
      • cb

        public DISPLAY_DEVICE cb(int value)
        Sets the specified value to the cb field.
      • set

        public DISPLAY_DEVICE set(DISPLAY_DEVICE src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • create

        public static DISPLAY_DEVICE create(long address)
        Returns a new DISPLAY_DEVICE instance for the specified memory address or null if the address is NULL.
      • create

        public static DISPLAY_DEVICE.Buffer create(long address,
                                                   int capacity)
        Create a DISPLAY_DEVICE.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity