On Thu, Jan 2, 2014 at 10:42 PM, 周训华 <906...@qq.com> 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
------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to