Re: [gtk-win32] Object Handle



lee designrealm co uk writes:
 > Thanks Tor,
 > That's right. Providing I can acquire a Windows specific id, which  
 > should be achievable due to the nature of Win32, then I can append the  
 > control.

I am afraid you might be in for a surprise, if you think it is that
easy. The control you try to embed might well assume that the message
handling code running in the thread is that of its own toolkit (MFC or
whatever), and other things.

I would be delighted to be proven wrong, though;)

 > The question is, how do I acquire a HWnd of any control in GTK?

Well, GTK+ doesn't use the terminology "control". The corresponding
thingie in GTK+ is called a widget. Some widgets have their own GDK
window, many don't (they are drawn on the parent widget's window). A
GDK window is implemented by a Win32 window. To get the Win32 HWND of
a GDK window (GdkWindow), or the HBITMAP of a GDK pixmap (GdkPixmap),
call gdk_win32_drawable_get_handle(). It returns a HGDIOBJ which
actually is a HWND or HBITMAP. To get the GdkWindow of a widget (that
has been realized), look at the window field of the GdkWidget class.

Google Code Search is your friend, use it to find examples of what
people have done with gdk_win32_drawable_get_handle().

--tml




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]