Class MSG

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class MSG extends Struct<MSG> implements NativeResource

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

    • SIZEOF

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

      public static final int ALIGNOF
      The struct alignment in bytes.
    • HWND

      public static final int HWND
      The struct member offsets.
    • MESSAGE

      public static final int MESSAGE
      The struct member offsets.
    • WPARAM

      public static final int WPARAM
      The struct member offsets.
    • LPARAM

      public static final int LPARAM
      The struct member offsets.
    • TIME

      public static final int TIME
      The struct member offsets.
    • PT

      public static final int PT
      The struct member offsets.
  • Constructor Details

    • MSG

      public MSG(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 Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<MSG>
    • 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.
    • pt

      public MSG pt(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

      public static @Nullable 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

      public static @Nullable 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(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

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

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

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

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

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

      public static MSG malloc(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(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, MemoryStack stack)
      Returns a new MSG.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static MSG.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new MSG.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • 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.