MOUSE_INPUT_DATA的Java等价物
Java Equivalent of MOUSE_INPUT_DATA
我正在尝试将C++MOUSE_INPUT_DATA结构转换为JNA。
typedef struct _MOUSE_INPUT_DATA {
USHORT UnitId;
USHORT Flags;
union {
ULONG Buttons;
struct {
USHORT ButtonFlags;
USHORT ButtonData;
};
};
ULONG RawButtons;
LONG LastX;
LONG LastY;
ULONG ExtraInformation;
} MOUSE_INPUT_DATA, *PMOUSE_INPUT_DATA;
我的最佳猜测
public static class _MOUSE_INPUT_DATA extends Structure {
public static class ByReference extends _MOUSE_INPUT_DATA implements Structure.ByReference {
public ByReference() {
}
public ByReference(Pointer memory) {
super(memory);
}
}
public _MOUSE_INPUT_DATA() {
}
public _MOUSE_INPUT_DATA(Pointer memory) {
super(memory);
read();
}
public WinDef.WORD unitId;
public WinDef.WORD flags;
public MOUSE_INPUT_DATA_UNION_STRUCT union = new MOUSE_INPUT_DATA_UNION_STRUCT();
public WinDef.ULONG rawButtons;
public WinDef.LONG lastX;
public WinDef.LONG lastY;
public BaseTSD.ULONG_PTR extraInformation;
protected List getFieldOrder() {
return Arrays.asList(new String[]{"unitId", "flags", "union", "rawButtons", "lastX", "lastY", "extraInformation"});
}
}
public static class MOUSE_INPUT_DATA_UNION_STRUCT extends Structure {
public static class ByReference extends MOUSE_INPUT_DATA_UNION_STRUCT implements Structure.ByReference {
public ByReference() {
}
public ByReference(Pointer memory) {
super(memory);
}
}
public MOUSE_INPUT_DATA_UNION_STRUCT() {
}
public MOUSE_INPUT_DATA_UNION_STRUCT(Pointer memory) {
super(memory);
read();
}
public _MOUSE_INPUT_DATA_UNION_STUCT_DETAIL union = new _MOUSE_INPUT_DATA_UNION_STUCT_DETAIL();
protected List getFieldOrder() {
return Arrays.asList(new String[]{"union"});
}
public static class _MOUSE_INPUT_DATA_UNION_STUCT_DETAIL extends Union {
public _MOUSE_INPUT_DATA_UNION_STUCT_DETAIL() {
}
public _MOUSE_INPUT_DATA_UNION_STUCT_DETAIL(Pointer memory) {
super(memory);
read();
}
public WinDef.ULONG buttons;
public WinDef.ULONG flagsAndData;
}
}
我正在使用它在自定义驱动程序中传递这个结构。我有一个Delphi应用程序,它可以很好地使用驱动程序和这个结构,但JAVA不是。
有人能告诉我哪里错了吗?
Ок。我找到了中间结果。
public class MOUSE_INPUT_DATA extends Structure {
public static class ByReference extends MOUSE_INPUT_DATA implements Structure.ByReference {
public ByReference() {
}
public ByReference(Pointer memory) {
super(memory);
}
}
public MOUSE_INPUT_DATA() {
}
public MOUSE_INPUT_DATA(Pointer memory) {
super(memory);
read();
}
public WinDef.WORD UnitId;
public WinDef.WORD Flags;
public WinDef.DWORD Buttons;
public WinDef.DWORD RawButtons;
public WinDef.DWORD LastX;
public WinDef.DWORD LastY;
public WinDef.DWORD ExtraInformation;
protected List getFieldOrder() {
return Arrays.asList(new String[]{"UnitId", "Flags", "Buttons", "RawButtons", "LastX", "LastY", "ExtraInformation"});
}
}
相关文章:
- 在C++STL中是否有Polyval(Matlab函数)等价物?
- 在java中解决这段代码时面临循环中的问题
- 尝试用java代码编译和运行c++代码
- python集合的C++等价物是什么.计数器
- 在这种情况下,java对象是否可以调用本机函数
- 在java中读取c++字节的位字段
- 为什么C++对链表中的下一个节点使用指针,而像 C# 或 Java 这样的语言只使用类 Node 的名称?
- 使用已使用 java 编码的 openssl 解码数据
- C++中是否存在 std::conditional 的懒惰等价物?
- SWIG Java 在使用 -DSWIGWORDSIZE64 时将int64_t转换为 jlong
- Android Java USB for native cpp
- 在由Sublime文本3编译后在cmd上显示Java程序输出
- C++ equivalent to Java Map getOrDefault?
- GLM中的Java Matrix4.transform等价物
- Java的EnumSet.allOf()C++等价物是什么?
- Java 的 split() 的 c++ 等价物是什么?
- 继承Java集合接口(Set、Map、List等)的C++等价物是什么?或者扩展AbstractCollection
- 什么是java中fopen_s()的等价物
- MOUSE_INPUT_DATA的Java等价物
- 什么是C++中Java注释的最佳等价物