手机
当前位置:查字典教程网 >编程开发 >C#教程 >获得.net控件的windows句柄的方法
获得.net控件的windows句柄的方法
摘要:复制代码代码如下:classWinAPI{[DllImport("coredll.dll")]privatestaticexternIntP...

复制代码 代码如下:

class WinAPI

{

[DllImport("coredll.dll")]

private static extern IntPtr SetCapture(IntPtr hWnd);

[DllImport("coredll.dll")]

private static extern IntPtr GetCapture();

public static IntPtr GetHWnd(Control ctrl)

{

IntPtr hOldWnd = GetCapture();

ctrl.Capture = true;

IntPtr hWnd = GetCapture();

ctrl.Capture = false;

SetCapture(hOldWnd);

return hWnd;

}

}

【获得.net控件的windows句柄的方法】相关文章:

C# 读取指定路径配置文件的方法

C#实现窗体淡入淡出效果的方法总结

c#简单读取文本的实例方法

C#图片压缩的实现方法

C#几种截取字符串的方法小结

利用Aspose.Word控件实现Word文档的操作

混合语言编程—C#使用原生的Directx和OpenGL绘图的方法

用.NET创建Windows服务的方法第1/2页

C#导出生成excel文件的方法小结(xml,html方式)

新手学习.net的一列好走的路径及方法

精品推荐
分类导航