手机
当前位置:查字典教程网 >编程开发 >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#导出生成excel文件的方法小结(xml,html方式)

c#重写TabControl控件实现关闭按钮的方法

WinForm子窗体访问父窗体控件的实现方法

c# winform取消右上角关闭按钮的实现方法

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

C#使用DllImport调用非托管的代码的方法

c#在控制台输出彩色文字的方法

C# 获取属性名的方法

C#中使用IrisSkin2.dll美化WinForm程序界面的方法

在Winform动态启动、控制台命令行的方法

精品推荐
分类导航