Class MSG

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


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

    Member documentation

    • hwnd – a handle to the window whose window procedure receives the message. This member is NULL when the message is a thread message.
    • message – the message identifier. Applications can only use the low word; the high word is reserved by the system.
    • wParam – additional information about the message. The exact meaning depends on the value of the message member.
    • lParam – additional information about the message. The exact meaning depends on the value of the message member.
    • time – the time at which the message was posted
    • pt – the cursor position, in screen coordinates, when the message was posted.

    Layout

     struct MSG {
         HWND hwnd;
         UINT message;
         WPARAM wParam;
         LPARAM lParam;
         DWORD time;
         POINT pt;
     }
    • Field Detail

      • SIZEOF

        public static final int SIZEOF
        The struct size in bytes.
    • 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()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • hwnd

        public long hwnd()
        Returns the value of the hwnd field.
      • message

        public int message()
        Returns the value of the message field.
      • wParam

        public long wParam()
        Returns the value of the wParam field.
      • lParam

        public long lParam()
        Returns the value of the lParam field.
      • time

        public int time()
        Returns the value of the time field.
      • pt

        public POINT pt()
        Returns a POINT view of the pt field.
      • 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(POINT value)
        Copies the specified POINT to the pt field.
      • 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 or null if the 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
      • mallocStack

        public static MSG mallocStack()
        Returns a new MSG instance allocated on the thread-local MemoryStack.
      • callocStack

        public static MSG callocStack()
        Returns a new MSG instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static MSG mallocStack(MemoryStack stack)
        Returns a new MSG instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static MSG callocStack(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
      • mallocStack

        public static MSG.Buffer mallocStack(int capacity)
        Returns a new MSG.Buffer instance allocated on the thread-local MemoryStack.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static MSG.Buffer callocStack(int capacity)
        Returns a new MSG.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

        public static MSG.Buffer mallocStack(int capacity,
                                             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
      • callocStack

        public static MSG.Buffer callocStack(int capacity,
                                             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