Brian J. Tarricone wrote:
fkater googlemail com wrote:For non-console apps, MSDN says I need to set up a WindowProc callback to catch WM_QUERYENDSESSION messages. But to register it, it seems I need hWnd from the main window which is somewhere hidden by gtk+...That's odd -- on X11, you can retrieve the native XID for a given GdkWindow, but it doesn't appear that the complementary functionality is available on win32 (GDK_WINDOW_HWND() appears to be private).
Er, my mistake... it looks like they aren't documented, but GDK_WINDOW_HWND(), which is just a wrapper around gdk_win32_drawable_get_handle(), may indeed be public. See:
http://svn.gnome.org/viewvc/gtk%2B/trunk/gdk/win32/gdkwin32.h?view=markupOdd that the win32 stuff doesn't show up in the docs on library.gnome.org, though.
-brian