// detect if given listviewitem has a checkbox
        internal static bool IsItemWithCheckbox(IntPtr hwnd, int item)
        {
            if (!WindowsListView.CheckBoxes(hwnd))
            {
                return(false);
            }

            // this listview supports checkbox, detect if
            // current item has it
            return(CheckState.NoCheckbox != (CheckState)WindowsListView.GetCheckedState(hwnd, item));
        }