getting a (valid) HWND from a Gtk::Window



Hello I've found less than a handful of threads on this issue on the entire
web. Perhaps this time this question will receive an answer from a win32
gtkmm dev? I hope so :-)

The question is how to get a valid HWND handle from a Gtk::Window.

I've tried using code I found elsewhere:

// Retrieve GdkWindow part of myWin.
GdkWindow* gdkWinPtr = my_gtk_window.get_window()->gobj();
// Retrieve Win32 application instance handle and window handle.
HWND hWnd = static_cast<HWND>(GDK_WINDOW_HWND(gdkWinPtr));

which compiles fine but when I pass the hWnd object to a recepient making
use of it (in this case the cross-platform Object-oriented Input System OIS)
it throws an invalid HWND exception.

the only member of the hWnd variable is unused with value 0.

it seems the guy who came up with that piece of code had little luck aswell:
http://webcache.googleusercontent.com/search?q=cache:MbNgp0YSEhcJ:osdir.com/ml/gnome.gtkmm/2002-11/msg00097.html+HINSTANCE+hInstance+%3D+static_cast%3CHINSTANCE%3E(GetModuleHandle(NULL))&cd=2&hl=sv&ct=clnk&gl=se

Is there a way to get a valid HWND handle from gtk+/gtkmm?

Thank you kindly
/nim

-- 
View this message in context: http://old.nabble.com/getting-a-%28valid%29-HWND-from-a-Gtk%3A%3AWindow-tp30676211p30676211.html
Sent from the Gtkmm mailing list archive at Nabble.com.



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