clipboard_monitor_in_win7
添加监听
AddClipboardFormatListener(this.Handle); 移除
RemoveClipboardFormatListener(this.Handle); #region 剪贴板监视器
[DllImport("user32.dll")]
public static extern bool AddClipboardFormatListener(IntPtr hwnd);
[DllImport("user32.dll")]
public static extern bool RemoveClipboardFormatListener(IntPtr hwnd);
private static int WM_CLIPBOARDUPDATE = 0x031D;
#endregion protected override void DefWndProc(ref Message m)
{
if (m.Msg == WM_CLIPBOARDUPDATE)
{
if (Clipboard.ContainsText())
{
//label1.Text = Clipboard.GetText();
this.pFramework.Application.CommandPool.EnableBarItem(typeof(YSC.PluginGIS.EditingPasteCommand).ToString(), true);
}
else if (Clipboard.ContainsImage())
{
//pictureBox1.Image = Clipboard.GetImage();
//pictureBox1.Update();
}
else
{
this.pFramework.Application.CommandPool.EnableBarItem(typeof(YSC.PluginGIS.EditingPasteCommand).ToString(), false);
}
}
else
{
base.DefWndProc(ref m);
}
}
clipboard_monitor_in_win7的更多相关文章
随机推荐
- 当窗体获得焦点时禁用max快捷键
最近一段时间一直在MXS里用dotnet写界面...写的各种头晕眼花... 过程中遇到了 TextBox 控件输入时 与max快捷键冲突的问题. 解决办法是 用 MaxTextBox 控件替换,今天请 ...
- NewQuant的设计(一)——整体的领域设计
NewQuant的设计思路——整体的领域分析 “领域驱动设计(DDD)”是著名软件工程建模专家Eric Evans提出的一个重要概念,是“面向对象分析设计(OOAD)”的深化.当业务逻辑变得复杂,系统 ...
- php 一些经常用到的方法
获取当前url地址 /** * 获取当前url * @author Red * @date * @return string */ function getRequestURL() { if (!is ...
- Eclipse中Sever启动成功,但tomcat无法管理页面无法访问。
- windows 自带的 端口映射 端口转向功能
安装IPV6 netsh interface ipv6 install查看 netsh interface portproxy show all添加 netsh interface portproxy ...
- 集群工具ansible使用方法
ansible简介 ansible是与puppet.saltstack类似的集群管理工具,其优点是仅需要ssh和Python即可使用,而不像puppet.saltstack那样都需要客户端.与pupp ...
- 简单的聊天室代码php+swoole
php swoole+websocket 客户端代码 <!DOCTYPE html> <html> <head> <title></title&g ...
- 使用.net 创建windows service
最近公司项目需要,写了个windows 服务,windows 服务的内容可以在VS 中新建一个"windows服务项目", (1)服务中的主要代码: public partial ...
- My Tornado Particle Effect
These animations are more able to demostrate this plugin than the following static images. :) test 1 ...
- Struts2中Action由自己与由Spring管理的区别
struts2单独使用时action由struts2自己负责创建:与spring集成时,action实例由spring负责创建. 这导致在两种情况下struts.xml配置文件的略微差异. 假如: ...