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

Ellis, Peter
Wed, 16 Jan 2008 00:03:14 -0000

Thanks, Alex.  That sounds very promising.  I know I can get an HWND in
Ruby using the Win32API library in Windows.  Just curious how might that
work in OS X?  I''ve been mainly developing my app on Windows, but it
will also need to work on OS X eventually.

P

-----Original Message-----
From: wxruby-users-bounces at rubyforge.org
[mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Alex Fenton
Sent: Tuesday, January 15, 2008 4:56 AM
To: General discussion of wxRuby
Subject: Re: [wxruby-users] How to get a Window handle from another app?

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#As
sociating_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

_______________________________________________
wxruby-users mailing list
wxruby-users at rubyforge.org