Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,11 @@ internal unsafe static extern SafeFileHandle CreateFile(


#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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2419,8 +2419,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;
}
Expand Down