public static extern uint SendMessage(IntPtr hWnd, int Msg, int wParam, ref REBARINFO lParam);
Exemple #2
0
 public static extern uint SendMessage(IntPtr hWnd, int Msg, int wParam, ref REBARINFO lParam);
Exemple #3
0
        protected void UpdateImageList()
        {
            if(_rebar != null)
            {
                REBARINFO RBInfo = new REBARINFO();
                RBInfo.cbSize = (uint)Marshal.SizeOf(RBInfo);
                RBInfo.fMask = (uint)RebarImageListConstants.RBIM_IMAGELIST;
                if(_imageList == null)
                {
                    RBInfo.himl = IntPtr.Zero;
                }
                else
                {
                    RBInfo.himl = _imageList.Handle;
                }
                if(User32Dll.SendMessage(_rebar.Handle,
                    (int)WindowsMessages.RB_SETBARINFO,
                    0,ref RBInfo)==0)
                {

                    int LastErr = Marshal.GetHRForLastWin32Error();
                    try
                    {
                        Marshal.ThrowExceptionForHR(LastErr);
                    }
                    catch (Exception ex)
                    {
                        System.Diagnostics.Debug.WriteLine(LastErr + " " + ex.Message);
                        if (_throwExceptions) throw(new Exception("Error Setting Imagelist.", ex));
                    }
                }
            }
        }