当前位置: 移动技术网 > IT编程>开发语言>c# > 获得.net控件的windows句柄的方法

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

2019年07月18日  | 移动技术网IT编程  | 我要评论
复制代码 代码如下:class winapi{  [dllimport("coredll.dll")]  private static extern intptr setc

复制代码 代码如下:

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;
  }
}

    

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网