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

Alex Fenton alex at pressure.to
Sun Jan 20 18:54:19 EST 2008


Ellis, Peter wrote:
> 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.
I had a look at the wxWidgets headers, and it seems that AssociateHandle 
and SetHandle aren't implemented on OS X, so it won't work the same way. 
GetHandle is, and I'm pretty sure you can already get a meaningful 
system window id on OS X with get_hwnd. Whether you can do anything 
useful with this + RubyCocoa I don't know.

alex


More information about the wxruby-users mailing list