diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-05-13 09:12:19 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-05-17 14:34:45 +0000 |
commit | af6b700bb8b8e73406e07d0544300706dd1e6f41 (patch) | |
tree | 340875987663795f99cedad72047aca3947b4ff8 /src/widgets/util | |
parent | 3eb3007e9c75eea81a2b20749dc61ca31c9bc699 (diff) |
QtWidgets: Increase Windows API level to 0x600 (Windows Vista).
Define WINVER, _WIN32_WINNT for MinGW in win.pri. Directly link to uxtheme and
dwmapi and remove dynamic loading of functions that are present in Windows
Vista onwards.
Remove duplicated declarations of constants that are now present in the SDKs.
Task-number: QTBUG-51673
Change-Id: I695a6673d7250b2788fd2f20aebd222fcabb0d47
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/widgets/util')
-rw-r--r-- | src/widgets/util/qsystemtrayicon_win.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/widgets/util/qsystemtrayicon_win.cpp b/src/widgets/util/qsystemtrayicon_win.cpp index f34714c016..3acf1fa777 100644 --- a/src/widgets/util/qsystemtrayicon_win.cpp +++ b/src/widgets/util/qsystemtrayicon_win.cpp @@ -200,7 +200,7 @@ QSystemTrayIconSys::QSystemTrayIconSys(HWND hwnd, QSystemTrayIcon *object) MYWM_TASKBARCREATED = RegisterWindowMessage(L"TaskbarCreated"); } - // Allow the WM_TASKBARCREATED message through the UIPI filter on Windows Vista and higher + // Allow the WM_TASKBARCREATED message through the UIPI filter on Windows 7 and higher static PtrChangeWindowMessageFilterEx pChangeWindowMessageFilterEx = (PtrChangeWindowMessageFilterEx)QSystemLibrary::resolve(QLatin1String("user32"), "ChangeWindowMessageFilterEx"); @@ -208,13 +208,14 @@ QSystemTrayIconSys::QSystemTrayIconSys(HWND hwnd, QSystemTrayIcon *object) // Call the safer ChangeWindowMessageFilterEx API if available (Windows 7 onwards) pChangeWindowMessageFilterEx(m_hwnd, MYWM_TASKBARCREATED, Q_MSGFLT_ALLOW, 0); } else { + // Call the deprecated ChangeWindowMessageFilter API otherwise (Vista onwards) + // May 2016: Still resolved at runtime since the definition is not present in MinGW 4.9. + // TODO: Replace by direct invocation when upgrading MinGW. static PtrChangeWindowMessageFilter pChangeWindowMessageFilter = (PtrChangeWindowMessageFilter)QSystemLibrary::resolve(QLatin1String("user32"), "ChangeWindowMessageFilter"); - if (pChangeWindowMessageFilter) { - // Call the deprecated ChangeWindowMessageFilter API otherwise + if (pChangeWindowMessageFilter) pChangeWindowMessageFilter(MYWM_TASKBARCREATED, Q_MSGFLT_ALLOW); - } } } @@ -413,6 +414,7 @@ QRect QSystemTrayIconSys::findIconGeometry(UINT iconId) UINT uID; }; + // Windows 7 onwards. static PtrShell_NotifyIconGetRect Shell_NotifyIconGetRect = (PtrShell_NotifyIconGetRect)QSystemLibrary::resolve(QLatin1String("shell32"), "Shell_NotifyIconGetRect"); |