Re: Capturing Win32 WM_* messages in gtkmm application



Mohith Manoj wrote:
Hello,

I have a gtkmm application running on window. Now there is this Win32 message (WM_DEVICECHANGE) that would help me detect device connect / disconnect event. I used to do it while I was using MSVC++. Nowadays after coming to gtkmm teritory I haven't seen much of Win32 messages.

How do I capture these win32 messages?

Using Gdk::Window::add_filter [1]. Gobby used to use it to wait for network events with WSAAsyncSelect, this might be helpful as an example [2].

Also note that a Gtk::Window's Gdk::Window does only exist after realization of the widget, use signal_realize() to wait for that to happen instead of accessing it directly after construction.

Armin

[1] http://library.gnome.org/devel/gtkmm/stable/classGdk_1_1Window.html#a413863a30bbac24d6d1a207401c07caf [2] http://git.0x539.de/?p=gobby.git;a=blob;f=src/io/main_connection_win32.cpp;h=b239d30c165782662050cae98614e9b24b078e71;hb=6d5da5685c3c272f4bb3cb064d61719b55b84fa1

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