Helper Methods for Connecting SysImageList to Common Controls
        public static void SetTreeViewImageList(TreeView treeView, SysImageList sysImageList, bool forStateImages)
        {
            IntPtr wParam = (IntPtr)0;

            if (forStateImages)
            {
                wParam = (IntPtr)2;
            }
            SysImageListHelper.SendMessage(treeView.Handle, 4361, wParam, sysImageList.Handle);
        }
        public static void SetListViewImageList(ListView listView, SysImageList sysImageList, bool forStateImages)
        {
            IntPtr wParam = (IntPtr)0;

            if (sysImageList.ImageListSize == SysImageListSize.smallIcons)
            {
                wParam = (IntPtr)1;
            }
            if (forStateImages)
            {
                wParam = (IntPtr)2;
            }
            SysImageListHelper.SendMessage(listView.Handle, 4099, wParam, sysImageList.Handle);
        }