Re: Win32 HWND

On Fri, 2008-11-14 at 00:08 +0100, Nikola Moraca wrote:
> I want to initialize Direct3D on a gtkmm window. Is there a way to
> obtain a win32 HWND for a Gtk::Window?

#include <gdk/gdkwin32.h>

HWND hwnd_from_window(Gtk::Window& window)
  return reinterpret_cast<HWND>(

Note that this requires that there exists a GdkWindow for the
Gtk::Window. This is only the case after realization of the widget. You
can connect to signal_realize() of the window to initialize the Direct3D
stuff directly after the widget was realized.

> Thanks


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