Class MSG

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

    public class MSG
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Contains message information from a thread's message queue.

    Layout

    
     struct MSG {
         HWND hwnd();
         UINT message();
         WPARAM wParam();
         LPARAM lParam();
         DWORD time();
         POINT pt();
     }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MSG.Buffer
      An array of MSG structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

        org.lwjgl.system.Pointer.Default
      • Nested classes/interfaces inherited from class org.lwjgl.system.Struct

        org.lwjgl.system.Struct.StructValidation
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALIGNOF
      The struct alignment in bytes.
      static int HWND
      LPARAM
      MESSAGE
      PT
      The struct member offsets.
      static int SIZEOF
      The struct size in bytes.
      static int TIME
      WPARAM
      The struct member offsets.
      • Fields inherited from interface org.lwjgl.system.Pointer

        BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
    • Constructor Summary

      Constructors 
      Constructor Description
      MSG​(java.nio.ByteBuffer container)
      Creates a MSG instance at the current position of the specified ByteBuffer container.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static MSG calloc()
      Returns a new MSG instance allocated with memCalloc.
      static MSG.Buffer calloc​(int capacity)
      Returns a new MSG.Buffer instance allocated with memCalloc.
      static MSG.Buffer calloc​(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new MSG.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      static MSG calloc​(org.lwjgl.system.MemoryStack stack)
      Returns a new MSG instance allocated on the specified MemoryStack and initializes all its bits to zero.
      static MSG callocStack()
      Deprecated.
      static MSG.Buffer callocStack​(int capacity)
      Deprecated.
      static MSG.Buffer callocStack​(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      static MSG callocStack​(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      static MSG create()
      Returns a new MSG instance allocated with BufferUtils.
      static MSG.Buffer create​(int capacity)
      Returns a new MSG.Buffer instance allocated with BufferUtils.
      static MSG create​(long address)
      Returns a new MSG instance for the specified memory address.
      static MSG.Buffer create​(long address, int capacity)
      Create a MSG.Buffer instance at the specified memory.
      static MSG createSafe​(long address)
      Like create, but returns null if address is NULL.
      static MSG.Buffer createSafe​(long address, int capacity)
      Like create, but returns null if address is NULL.
      long hwnd()
      a handle to the window whose window procedure receives the message.
      MSG hwnd​(long value)
      Sets the specified value to the hwnd() field.
      long lParam()
      additional information about the message.
      MSG lParam​(long value)
      Sets the specified value to the lParam() field.
      static MSG malloc()
      Returns a new MSG instance allocated with memAlloc.
      static MSG.Buffer malloc​(int capacity)
      Returns a new MSG.Buffer instance allocated with memAlloc.
      static MSG.Buffer malloc​(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new MSG.Buffer instance allocated on the specified MemoryStack.
      static MSG malloc​(org.lwjgl.system.MemoryStack stack)
      Returns a new MSG instance allocated on the specified MemoryStack.
      static MSG mallocStack()
      Deprecated.
      static MSG.Buffer mallocStack​(int capacity)
      Deprecated.
      static MSG.Buffer mallocStack​(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      static MSG mallocStack​(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      int message()
      the message identifier.
      MSG message​(int value)
      Sets the specified value to the message() field.
      static long nhwnd​(long struct)
      Unsafe version of hwnd().
      static void nhwnd​(long struct, long value)
      Unsafe version of hwnd.
      static long nlParam​(long struct)
      Unsafe version of lParam().
      static void nlParam​(long struct, long value)
      Unsafe version of lParam.
      static int nmessage​(long struct)
      Unsafe version of message().
      static void nmessage​(long struct, int value)
      Unsafe version of message.
      static POINT npt​(long struct)
      Unsafe version of pt().
      static void npt​(long struct, POINT value)
      Unsafe version of pt.
      static int ntime​(long struct)
      Unsafe version of time().
      static void ntime​(long struct, int value)
      Unsafe version of time.
      static long nwParam​(long struct)
      Unsafe version of wParam().
      static void nwParam​(long struct, long value)
      Unsafe version of wParam.
      POINT pt()
      the cursor position, in screen coordinates, when the message was posted.
      MSG pt​(java.util.function.Consumer<POINT> consumer)
      Passes the pt() field to the specified Consumer.
      MSG pt​(POINT value)
      Copies the specified POINT to the pt() field.
      MSG set​(long hwnd, int message, long wParam, long lParam, int time, POINT pt)
      Initializes this struct with the specified values.
      MSG set​(MSG src)
      Copies the specified struct data to this struct.
      int sizeof()  
      int time()
      the time at which the message was posted
      MSG time​(int value)
      Sets the specified value to the time() field.
      long wParam()
      additional information about the message.
      MSG wParam​(long value)
      Sets the specified value to the wParam() field.
      • Methods inherited from interface org.lwjgl.system.NativeResource

        close, free
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from class org.lwjgl.system.Pointer.Default

        address, equals, hashCode, toString
      • Methods inherited from class org.lwjgl.system.Struct

        clear, free, isNull, validate
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • HWND, MESSAGE, WPARAM, LPARAM, TIME, PT

        The struct member offsets.
    • Constructor Detail

      • MSG

        public MSG​(java.nio.ByteBuffer container)
        Creates a MSG 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()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • hwnd

        public long hwnd()
        a handle to the window whose window procedure receives the message. This member is NULL when the message is a thread message.
      • message

        public int message()
        the message identifier. Applications can only use the low word; the high word is reserved by the system.
      • wParam, lParam

        public long wParam()
        
        public long lParam()
        
        additional information about the message. The exact meaning depends on the value of the message member.
      • time

        public int time()
        the time at which the message was posted
      • pt

        public POINT pt()
        the cursor position, in screen coordinates, when the message was posted.
      • hwnd

        public MSG hwnd​(long value)
        Sets the specified value to the hwnd() field.
      • message

        public MSG message​(int value)
        Sets the specified value to the message() field.
      • wParam

        public MSG wParam​(long value)
        Sets the specified value to the wParam() field.
      • lParam

        public MSG lParam​(long value)
        Sets the specified value to the lParam() field.
      • time

        public MSG time​(int value)
        Sets the specified value to the time() field.
      • pt

        public MSG pt​(java.util.function.Consumer<POINT> consumer)
        Passes the pt() field to the specified Consumer.
      • set

        public MSG set​(long hwnd,
                       int message,
                       long wParam,
                       long lParam,
                       int time,
                       POINT pt)
        Initializes this struct with the specified values.
      • set

        public MSG set​(MSG src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • malloc

        public static MSG malloc()
        Returns a new MSG instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static MSG calloc()
        Returns a new MSG instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static MSG create()
        Returns a new MSG instance allocated with BufferUtils.
      • create

        public static MSG create​(long address)
        Returns a new MSG instance for the specified memory address.
      • createSafe

        @Nullable
        public static MSG createSafe​(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static MSG.Buffer malloc​(int capacity)
        Returns a new MSG.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static MSG.Buffer calloc​(int capacity)
        Returns a new MSG.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

        public static MSG.Buffer create​(int capacity)
        Returns a new MSG.Buffer instance allocated with BufferUtils.
        Parameters:
        capacity - the buffer capacity
      • create

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

        @Nullable
        public static MSG.Buffer createSafe​(long address,
                                            int capacity)
        Like create, but returns null if address is NULL.
      • mallocStack

        @Deprecated
        public static MSG mallocStack()
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

        @Deprecated
        public static MSG callocStack()
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
      • mallocStack

        @Deprecated
        public static MSG mallocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

        @Deprecated
        public static MSG callocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
      • mallocStack

        @Deprecated
        public static MSG.Buffer mallocStack​(int capacity,
                                             org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
      • callocStack

        @Deprecated
        public static MSG.Buffer callocStack​(int capacity,
                                             org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
      • malloc

        public static MSG malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new MSG instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static MSG calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new MSG instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • malloc

        public static MSG.Buffer malloc​(int capacity,
                                        org.lwjgl.system.MemoryStack stack)
        Returns a new MSG.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • calloc

        public static MSG.Buffer calloc​(int capacity,
                                        org.lwjgl.system.MemoryStack stack)
        Returns a new MSG.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nhwnd

        public static long nhwnd​(long struct)
        Unsafe version of hwnd().
      • nmessage

        public static int nmessage​(long struct)
        Unsafe version of message().
      • nwParam

        public static long nwParam​(long struct)
        Unsafe version of wParam().
      • nlParam

        public static long nlParam​(long struct)
        Unsafe version of lParam().
      • ntime

        public static int ntime​(long struct)
        Unsafe version of time().
      • npt

        public static POINT npt​(long struct)
        Unsafe version of pt().
      • nhwnd

        public static void nhwnd​(long struct,
                                 long value)
        Unsafe version of hwnd.
      • nmessage

        public static void nmessage​(long struct,
                                    int value)
        Unsafe version of message.
      • nwParam

        public static void nwParam​(long struct,
                                   long value)
        Unsafe version of wParam.
      • nlParam

        public static void nlParam​(long struct,
                                   long value)
        Unsafe version of lParam.
      • ntime

        public static void ntime​(long struct,
                                 int value)
        Unsafe version of time.
      • npt

        public static void npt​(long struct,
                               POINT value)
        Unsafe version of pt.