简体   繁体   English

WPF:在WinForms上从Windows上使用Snoop?

[英]WPF: use Snoop on Windows launched from WinForms?

是否有可能窥探从WinForms应用程序启动的WPF Windows?

Yes it is. 是的。 Snoop can easily be used with WPF Windows launched from a WinForms app. Snoop可以很容易地与从WinForms应用程序启动的WPF Windows一起使用。 Specifically, Snoop will: 具体来说,Snoop将:

  1. Offer to let you select any process that loads PresentationFramework.dll and that doesn't contain "devenv" in its name. 允许您选择加载PresentationFramework.dll且名称中不包含“devenv”的任何进程。
  2. Actually let you to snoop or magnify any process that meets the conditions in #1 and also has at least one active PresentationSource (such as an open Window or an ElementHost) in its default AppDomain. 实际上,让您窥探或放大符合条件#1的任何进程,并且在其默认AppDomain中至少有一个活动的PresentationSource(例如打开的Window或ElementHost)。

Note that when Snoop first attaches to a process it displays Application.MainWindow, or if that isn't set, the first PresentationSource registered that is still showing. 请注意,当Snoop首次附加到进程时,它会显示Application.MainWindow,或者如果未设置,则会注册仍在显示的第一个PresentationSource。 This doesn't stop you from snooping other WPF content, however: Just place the mouse over the WPF content you want to snoop and hit Ctrl+Shift. 但是,这并不能阻止您窥探其他WPF内容:只需将鼠标放在要监听的WPF内容上,然后按Ctrl + Shift即可。

Nitpick: What Snoop does isn't actually called "profiling." Nitpick:Snoop所做的事实上并没有被称为“剖析”。 "Profiling" means measuring what methods are called and how much time is spent in them. “分析”意味着测量所谓的方法以及花费多少时间。 So to be very precise the answer is "no," but I doubt you were really asking about profiling. 所以非常准确地说答案是“不”,但我怀疑你是否真的在询问分析。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM