我在我的WinForms应用程序中使用了Application.AddMessageFilter()(使用非托管代码时)。现在我正在切换到WPF,但找不到此功能。请告知在哪里可以找到或实现它。 最佳答案 在WPF中,可以使用ComponentDispatcher.ThreadFilterMessage事件。ComponentDispatcher.ThreadFilterMessage+=ComponentDispatcher_ThreadFilterMessage;privatevoidComponentDispatcher_Thr