Exemplo n.º 1
0
 public static extern IntPtr SendMessage
 (
     IntPtr hwnd,
     int wMsg,
     int wParam,
     ref LVCOLUMNW lParam
 );
Exemplo n.º 2
0
 public static extern int InsertColumn
 (
     IntPtr hWnd,
     int Msg,
     int wParam,
     ref LVCOLUMNW lParam
 );
Exemplo n.º 3
0
        public unsafe Columns()
        {
            InitializeComponent();

            char *pText  = stackalloc char[256];
            var   column = new LVCOLUMNW
            {
                mask       = (LVCF)uint.MaxValue,
                cchTextMax = 256,
                pszText    = pText
            };
            IntPtr r = User32.SendMessageW(listView1.Handle, (User32.WindowMessage)LVM.GETCOLUMN, (IntPtr)0, ref column);
            string s = new string(pText);
        }
Exemplo n.º 4
0
        private unsafe void Reload()
        {
            LVCF mask =
                LVCF.FMT |
                LVCF.TEXT |
                LVCF.IMAGE |
                LVCF.WIDTH |
                LVCF.MINWIDTH;
            var column = new LVCOLUMNW
            {
                mask       = mask,
                cchTextMax = textTextBox.Text.Length,
                iImage     = (int)imageIndexNumericUpDown.Value,
                cx         = (int)widthNumericUpDown.Value,
                cxMin      = (int)minimumWidthNumericUpDown.Value,
            };

            if (fixedWidthCheckBox.Checked)
            {
                column.fmt |= LVCFMT.FIXED_WIDTH;
            }
            if (splitButtonCheckBox.Checked)
            {
                column.fmt |= LVCFMT.SPLITBUTTON;
            }

            switch (alignComboBox.SelectedIndex)
            {
            case 0:
                column.fmt |= LVCFMT.LEFT;
                break;

            case 1:
                column.fmt |= LVCFMT.CENTER;
                break;

            case 2:
                column.fmt |= LVCFMT.RIGHT;
                break;
            }

            fixed(char *pText = textTextBox.Text)
            {
                column.pszText = pText;
                User32.SendMessageW(listView1.Handle, (User32.WindowMessage)LVM.SETCOLUMN, (IntPtr)1, ref column);
            }
        }
Exemplo n.º 5
0
 public static extern IntPtr SendMessage_LvColumn(IntPtr hWnd, int Msg, IntPtr nIndex, ref LVCOLUMNW pColumn);