diff options
| -rw-r--r-- | src/plugins/platforms/windows/qwindowscontext.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 20a9e2da94..5765b5aa6c 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -643,9 +643,10 @@ QString QWindowsContext::registerWindowClass(QString cname, // has already been registered by another instance of Qt then // add a UUID. The check needs to be performed for each name // in case new message windows are added (QTBUG-81347). + // Note: GetClassInfo() returns != 0 when a class exists. const auto appInstance = static_cast<HINSTANCE>(GetModuleHandle(nullptr)); WNDCLASS wcinfo; - const bool classExists = GetClassInfo(appInstance, reinterpret_cast<LPCWSTR>(cname.utf16()), &wcinfo) == TRUE + const bool classExists = GetClassInfo(appInstance, reinterpret_cast<LPCWSTR>(cname.utf16()), &wcinfo) != FALSE && wcinfo.lpfnWndProc != proc; if (classExists) |
