diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-12-26 19:49:55 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-12-26 19:49:55 (GMT) |
commit | 24270550463fbc81c7725595719e6e21eade2819 (patch) | |
tree | 4e7c118ed3c4b42e43403960365a2672441ea05e /src/gui/util | |
parent | 4376f8871b4422830e9ffb7f3acbc29766d8d218 (diff) | |
parent | 444fb94e02308bedc7b37a702adb95b740168a94 (diff) | |
download | Qt-24270550463fbc81c7725595719e6e21eade2819.zip Qt-24270550463fbc81c7725595719e6e21eade2819.tar.gz Qt-24270550463fbc81c7725595719e6e21eade2819.tar.bz2 |
Merge branch '4.6'
Conflicts:
examples/webkit/fancybrowser/main.cpp
src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
tools/assistant/tools/assistant/bookmarkmanager.cpp
Diffstat (limited to 'src/gui/util')
-rw-r--r-- | src/gui/util/qsystemtrayicon_p.h | 1 | ||||
-rw-r--r-- | src/gui/util/qsystemtrayicon_win.cpp | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/gui/util/qsystemtrayicon_p.h b/src/gui/util/qsystemtrayicon_p.h index 86de366..029a259 100644 --- a/src/gui/util/qsystemtrayicon_p.h +++ b/src/gui/util/qsystemtrayicon_p.h @@ -94,6 +94,7 @@ public: class QBalloonTip : public QWidget { + Q_OBJECT public: static void showBalloon(QSystemTrayIcon::MessageIcon icon, const QString& title, const QString& msg, QSystemTrayIcon *trayIcon, diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp index 362be5b..474555b 100644 --- a/src/gui/util/qsystemtrayicon_win.cpp +++ b/src/gui/util/qsystemtrayicon_win.cpp @@ -83,7 +83,11 @@ struct Q_NOTIFYICONIDENTIFIER { GUID guidItem; }; +#define Q_MSGFLT_ALLOW 1 + typedef HRESULT (WINAPI *PtrShell_NotifyIconGetRect)(const Q_NOTIFYICONIDENTIFIER* identifier, RECT* iconLocation); +typedef BOOL (WINAPI *PtrChangeWindowMessageFilter)(UINT message, DWORD dwFlag); +typedef BOOL (WINAPI *PtrChangeWindowMessageFilterEx)(HWND hWnd, UINT message, DWORD action, void* pChangeFilterStruct); class QSystemTrayIconSys : QWidget { @@ -143,6 +147,23 @@ QSystemTrayIconSys::QSystemTrayIconSys(QSystemTrayIcon *object) if (!MYWM_TASKBARCREATED) { MYWM_TASKBARCREATED = RegisterWindowMessage(L"TaskbarCreated"); } + + // Allow the WM_TASKBARCREATED message through the UIPI filter on Windows Vista and higher + static PtrChangeWindowMessageFilterEx pChangeWindowMessageFilterEx = + (PtrChangeWindowMessageFilterEx)QLibrary::resolve(QLatin1String("user32"), "ChangeWindowMessageFilterEx"); + + if (pChangeWindowMessageFilterEx) { + // Call the safer ChangeWindowMessageFilterEx API if available + pChangeWindowMessageFilterEx(winId(), MYWM_TASKBARCREATED, Q_MSGFLT_ALLOW, 0); + } else { + static PtrChangeWindowMessageFilter pChangeWindowMessageFilter = + (PtrChangeWindowMessageFilter)QLibrary::resolve(QLatin1String("user32"), "ChangeWindowMessageFilter"); + + if (pChangeWindowMessageFilter) { + // Call the deprecated ChangeWindowMessageFilter API otherwise + pChangeWindowMessageFilter(MYWM_TASKBARCREATED, Q_MSGFLT_ALLOW); + } + } } QSystemTrayIconSys::~QSystemTrayIconSys() |