【发布时间】:2014-06-18 08:25:02
【问题描述】:
在我的 ctypes 中
TBButton.ptr(ctypes.UInt64("0x1e677e60")
这相当于这里这行代码中的aButton.address():
var rez = SendMessage(hToolbar, 0x417 /** TB_GETBUTTON **/, 1, aButton.address());
当我运行这段代码时,我得到了错误:
异常:预期类型 intptr_t,得到 TBButton.ptr(ctypes.UInt64("0xaa4eb20"))
所以这是因为在我的SendMessage 定义中我有这个:
var SendMessage = user32.declare('SendMessageW', ctypes.winapi_abi, ctypes.intptr_t,
ctypes.voidptr_t, // HWND
ctypes.uint32_t, // MSG
ctypes.uintptr_t, // WPARAM
ctypes.intptr_t // LPARAM
);
所以我的问题是:TBButton.ptr(ctypes.UInt64("0x1e677e60") 的类型是什么,所以我可以将 SendMessage 定义中的 LPARAM 更改为这种类型。
或者:是否可以将其设为intptr_t?
ctypes.intptr_t(aButton.address()) 之类的东西,我试过了,它不起作用。
【问题讨论】:
标签: javascript firefox-addon jsctypes