On Thu, Jan 2, 2014 at 10:42 PM, 周训华 <90...@qq...> wrote:
> Hi,
> I'm trying make application by wxLua。I want to post/send windows
> message(in C++) to wxWindow(created in lua ),so I need get the window's
> handle. But the class "wxWindow" 's method "void* GetHandle" can not return
> a right value to use in C++. So,I hope the wxWindow's method "GetHandle"
> return a "long" as same as in wxPython.
> Looking forward to your reply,Thanks.
> ------------------------------
>
If you are in C++ using a wxWindow created by wxLua I would simply get the
pointer to the wxWindow using one of the wxWindow::FindWindow*() functions
and call GetHandle() directly.
Unfortunately wxLua cannot return 'long' for wxWindow::GetHandle() since
Lua only has a 'double' number datatype. wxLua uses Lua's light-userdata
which is designed to hold a void* ptr. To be sure, the 'long' is simply the
void* ptr casted and you can cast the void* to the HWND directly if you
need to.
Regards,
John
|