diff options
author | Yuhang Zhao <2546789017@qq.com> | 2022-07-25 10:35:29 +0800 |
---|---|---|
committer | Yuhang Zhao <2546789017@qq.com> | 2022-08-03 23:24:21 +0800 |
commit | 8a0e0f8cc1f93d4f5fe205de75cacd2265017395 (patch) | |
tree | 82643a28e537e04c37ef9bd36d7fe62499f20fcf /src/corelib/kernel/qeventdispatcher_win.cpp | |
parent | fb1b20eab30096f3f9edf3da1200fbe8e2f66b2c (diff) |
QtBase: Windows: Replace some deprecated API usages
Microsoft recommends to use CoInitializeEx()
and SetWindowLongPtr()/GetWindowLongPtr() in new code.
Use COINIT_DISABLE_OLE1DDE to avoid overhead of
initializing and using obsolete technology.
Pick-to: 6.4
Change-Id: I9d16943e864d4487dd4f46fd9325579c298c52b9
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/corelib/kernel/qeventdispatcher_win.cpp')
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_win.cpp | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 709e1494b9..04e1abf16a 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -99,11 +99,7 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA if (dispatcher->filterNativeEvent(QByteArrayLiteral("windows_dispatcher_MSG"), &msg, &result)) return result; -#ifdef GWLP_USERDATA auto q = reinterpret_cast<QEventDispatcherWin32 *>(GetWindowLongPtr(hwnd, GWLP_USERDATA)); -#else - auto q = reinterpret_cast<QEventDispatcherWin32 *>(GetWindowLong(hwnd, GWL_USERDATA)); -#endif QEventDispatcherWin32Private *d = nullptr; if (q != nullptr) d = q->d_func(); @@ -289,11 +285,7 @@ static HWND qt_create_internal_window(const QEventDispatcherWin32 *eventDispatch return 0; } -#ifdef GWLP_USERDATA SetWindowLongPtr(wnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(eventDispatcher)); -#else - SetWindowLong(wnd, GWL_USERDATA, reinterpret_cast<LONG>(eventDispatcher)); -#endif return wnd; } |