我正在尝试获取所有告诉用户已触摸屏幕的 Windows 消息。当它被禁用时,它可以在任何地方工作,除了按钮。单击禁用控件时,应用程序似乎没有收到任何消息。
我正在使用 OpenNetCF Application2 类来过滤消息:
Application2.AddMessageFilter(Device.PowerManager);
Application2.Run(new MainForm());
PowerManager 类包含以下方法(根据 IMessageFilter 接口的要求):
public bool PreFilterMessage(ref Microsoft.WindowsCE.Forms.Message m)
{
log.DebugFormat("windows message {0} - 0x{0:X}", m.Msg);
if (m.Msg == 0x0201 || m.Msg == 0x8001 || m.Msg == 0x0005)
{
return this.ResetPowerManager();
}
return false;
}
在日志文件中,单击禁用按钮时没有显示 Windows 消息。我想知道这怎么可能,我怎样才能得到这个消息。