源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

获得.net控件的windows句柄的方法

  • 时间:2021-09-14 05:59 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:获得.net控件的windows句柄的方法
[u]复制代码[/u] 代码如下:
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;   } }     
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部