The Enable attribute of the control in the Windows API settings window, apienable

Source: Internet
Author: User

The Enable attribute of the control in the Windows API settings window, apienable

Reference page:

Http://www.yuanjiaocheng.net/webapi/create-crud-api-1-put.html

Http://www.yuanjiaocheng.net/webapi/create-crud-api-1-delete.html

Http://www.yuanjiaocheng.net/webapi/Consume-web-api.html

Http://www.yuanjiaocheng.net/webapi/mvc-consume-webapi-get.html

Http://www.yuanjiaocheng.net/webapi/mvc-consume-webapi-post.html

Related interfaces C # interoperability and sending

[DllImport ("user32.dll")] unsafe public static extern bool UpdateWindow (IntPtr hWnd); // update window [DllImport ("user32.dll")] unsafe public static extern bool EnableWindow (IntPtr hWnd, bool bEnable); // set the Enable attribute [DllImport ("user32.dll")] unsafe public static extern IntPtr find1_wex (IntPtr hwndParent, IntPtr failed, string lpszClass, string lpszWindow); // query window/Control

NOTE:
【FindWindowEx】:https://msdn.microsoft.com/en-us/library/ms633500(VS.85).aspx
【UpdateWindow】:https://msdn.microsoft.com/library/windows/desktop/dd145167
【FindWindowEx】:https://msdn.microsoft.com/en-us/library/windows/desktop/ms646291(v=vs.85).aspx

Code segment for obtaining the window sub-control handle

  private List<IntPtr> GetAllChildrenWindowHandles(IntPtr hParent, int maxCount)  {      var handles = new List<IntPtr>();      int ct = 0;      IntPtr prevChild = IntPtr.Zero;      IntPtr currChild = IntPtr.Zero;      while (true && ct < maxCount)      {          currChild = FindWindowEx(hParent, prevChild, null, null);          if (currChild == IntPtr.Zero) break;          handles.Add(currChild);          prevChild = currChild;          ++ct;      }      return handles;  }

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.