[wxruby-users] How to get a Window handle from another app?

Alex Fenton
Tue, 15 Jan 2008 11:55:50 -0000

Hi

Ellis, Peter wrote:
>
> I would like to get a window handle from another app outside of wxRuby
> and convert it into a wxRuby Window handle so that I can use it as the
> parent Window for several wxRuby child windows.  Basically I want to
> use the FRAME_FLOAT_ON_PARENT window style so that my wxRuby windows
> become associated with the outside app kind of like toolbars, e.g.,
> they don''t show up in the taskbar and are always floating on top
of my
> target app.
>
[plain text is preferred on this list, please]

This reference from C++ wxWidgets and a few others seem to suggest a
HWND window identifier can be linked to a Wx::Window using the
AssociateHandle method call:
http://www.wxwidgets.org/wiki/index.php/WxWidgets_For_MFC_Programmers#Associating_HWNDs_with_wxWindow_instances

However, although the AssociateHandle call is listed in the headers,
it''s not listed in the wxWidgets documentation. So at present
it''s not
available in wxRuby. I will see if it''s possible to add this call for
the next release.

alex