QEventDispatcherWin32's internal Window should be a Message-Only Window
authorDebao Zhang <dbzhang800@gmail.com>
Thu, 17 Nov 2011 13:16:47 +0000 (21:16 +0800)
committerQt by Nokia <qt-info@nokia.com>
Fri, 13 Jan 2012 08:38:05 +0000 (09:38 +0100)
A message-only window enables you to send and receive messages. It is
not visible, has no z-order, cannot be enumerated, and does not receive
broadcast messages. The window simply dispatches messages.

Task-number: QTBUG-17144

Change-Id: Ibaf18f9ef5165166bf0b88e2f4952faba96d5eef
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/corelib/kernel/qeventdispatcher_win.cpp

index fe570c3..3ade11c 100644 (file)
@@ -481,11 +481,16 @@ static HWND qt_create_internal_window(const QEventDispatcherWin32 *eventDispatch
     wc.lpszClassName = reinterpret_cast<const wchar_t *> (className.utf16());
 
     RegisterClass(&wc);
+#ifdef Q_OS_WINCE
+    HWND parent = 0;
+#else
+    HWND parent = HWND_MESSAGE;
+#endif
     HWND wnd = CreateWindow(wc.lpszClassName,  // classname
                             wc.lpszClassName,  // window name
                             0,                 // style
                             0, 0, 0, 0,        // geometry
-                            0,                 // parent
+                            parent,            // parent
                             0,                 // menu handle
                             qWinAppInst(),     // application
                             0);                // windows creation data.