The problem was that every child widget of the native widnow got it's own window descriptor (HWND), so, for example, if I hit the menubar, in nativeEvent I saw that the message had a different descriptor than the main window had.
This is what solved my problem: