[gtkmm] [Win32] Retrieving the HINSTANCE and HWND from gtkmm2.

I have not yet been able to try out gtkmm2 (see my previous posts in the "Building libsigc++ under Win32 for use with Intel C++ Compiler 6.0" thread). However I'm getting closer every day because of all the help I'm getting. Thanks guys!

Anyway, in the meantime I have been speculating over how to do certain things with gtkmm2. After some Googling and doc reading I came up with this to retrieve the HINSTANCE of the application and the HWND of a Gtk::Window called myWin:

// Retrieve GdkWindow part of myWin.
GdkWindow* gdkWinPtr = myWin.get_window()->gobj();

// Retrieve Win32 application instance handle and window handle.
HINSTANCE hInstance = static_cast<HINSTANCE>(GetModuleHandle(NULL));
HWND hWnd = static_cast<HWND>(GDK_WINDOW_XWINDOW(gdkWinPtr));

However, I have obviously not been able to test this. Is it correct?

Kind regards,
Dirk Gerrits

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