📄 filters.cs
字号:
//==========================================================================================
//
// OpenNETCF.Samples.ApplicationExCSharp.Filters
// Copyright (c) 2003, OpenNETCF.org
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the OpenNETCF.org Shared Source License.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the OpenNETCF.org Shared Source License
// for more details.
//
// You should have received a copy of the OpenNETCF.org Shared Source License
// along with this library; if not, email licensing@opennetcf.org to request a copy.
//
// If you wish to contact the OpenNETCF Advisory Board to discuss licensing, please
// email licensing@opennetcf.org.
//
// For general enquiries, email enquiries@opennetcf.org or visit our website at:
// http://www.opennetcf.org
//
//==========================================================================================
using System;
using OpenNETCF.Windows.Forms;
using Microsoft.WindowsCE.Forms;
namespace OpenNETCF.Samples.ApplicationExCSharp
{
class MouseFilter : IMessageFilter
{
#region IMessageFilter Members
public bool PreFilterMessage(ref Message m)
{
switch((WinMsg)m.Msg)
{
case WinMsg.WM_LBUTTONDBLCLK:
System.Windows.Forms.MessageBox.Show("Double Click!");
break;
}
return false;
}
#endregion
}
class KeyFilter : IMessageFilter
{
#region IMessageFilter Members
public bool PreFilterMessage(ref Message m)
{
int key = m.WParam.ToInt32();
switch((WinMsg)m.Msg)
{
case WinMsg.WM_CHAR:
switch(key)
{
case 48:
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
// filter out any numbers pressed
return true;
}
break;
}
return false;
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -