Download GetComboBoxInfoDemo.zip version 1.0.0.0, last updated 29/09/2013 (8.49 KB)

Download
  • md5: 4fcc1a5a01f589b63820d14e3288db50
using System;
using System.Runtime.InteropServices;

namespace GetComboBoxInfoDemo
{
  // Getting the hWnd of the edit component within a ComboBox contro
  // http://cyotek.com/blog/getting-the-hwnd-of-the-edit-component-within-a-combobox-control

  internal class NativeMethods
  {
    // ReSharper disable InconsistentNaming

    #region Class Members

    [DllImport("user32.dll")]
    public static extern bool GetComboBoxInfo(IntPtr hWnd, ref COMBOBOXINFO pcbi);

    #endregion

    #region Nested Types

    [StructLayout(LayoutKind.Sequential)]
    public struct COMBOBOXINFO
    {
      public int cbSize;

      public RECT rcItem;

      public RECT rcButton;

      public int stateButton;

      public IntPtr hwndCombo;

      public IntPtr hwndEdit;

      public IntPtr hwndList;
    }

    [StructLayout(LayoutKind.Sequential)]
    public struct RECT
    {
      public int left;

      public int top;

      public int right;

      public int bottom;
    }

    #endregion

    // ReSharper restore InconsistentNaming
  }
}

Donate

Donate