未验证 提交 194e4ec4 编写于 作者: A Ashish Kumar Singh 提交者: GitHub

preserve extra info across PeekMessage (#5838) (#6001)

Co-authored-by: NSam Bent <sambent@microsoft.com>
上级 16f75cd6
......@@ -187,9 +187,11 @@ internal interface IInternetSecurityManager
#if BASE_NATIVEMETHODS
[DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
internal static extern IntPtr GetMessageExtraInfo();
[DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
internal static extern IntPtr SetMessageExtraInfo(IntPtr lParam);
#endif
#if BASE_NATIVEMETHODS
......
......@@ -2417,8 +2417,14 @@ internal bool CriticalRequestProcessing(bool force)
}
else if (_postedProcessingType == PROCESS_FOREGROUND)
{
// Preserve the thread's current "extra message info"
// (PeekMessage overwrites it).
IntPtr extraInformation = UnsafeNativeMethods.GetMessageExtraInfo();
MSG msg = new MSG();
UnsafeNativeMethods.PeekMessage(ref msg, new HandleRef(this, _window.Value.Handle), _msgProcessQueue, _msgProcessQueue, NativeMethods.PM_REMOVE);
UnsafeNativeMethods.SetMessageExtraInfo(extraInformation);
}
_postedProcessingType = PROCESS_NONE;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册