diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 20a9e2da941..5765b5aa6c2 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(GetModuleHandle(nullptr)); WNDCLASS wcinfo; - const bool classExists = GetClassInfo(appInstance, reinterpret_cast(cname.utf16()), &wcinfo) == TRUE + const bool classExists = GetClassInfo(appInstance, reinterpret_cast(cname.utf16()), &wcinfo) != FALSE && wcinfo.lpfnWndProc != proc; if (classExists)