コード例 #1
0
ファイル: Rebar.cs プロジェクト: scskarsper/Cadencii_UTAU
 protected void UpdateImageList()
 {
     if (_rebar != null)
     {
         REBARINFO RBInfo = new REBARINFO();
         RBInfo.cbSize = (uint)Marshal.SizeOf(RBInfo);
         RBInfo.fMask  = (uint)win32.RBIM_IMAGELIST;
         if (_imageList == null)
         {
             RBInfo.himl = IntPtr.Zero;
         }
         else
         {
             RBInfo.himl = _imageList.Handle;
         }
         if (win32.SendMessage(_rebar.Handle,
                               (int)win32.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));
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: Rebar.cs プロジェクト: kixtarte/cadencii
        protected void UpdateImageList() {
            if ( _rebar != null ) {
                REBARINFO RBInfo = new REBARINFO();
                RBInfo.cbSize = (uint)Marshal.SizeOf( RBInfo );
                RBInfo.fMask = (uint)win32.RBIM_IMAGELIST;
                if ( _imageList == null ) {
                    RBInfo.himl = IntPtr.Zero;
                } else {
                    RBInfo.himl = _imageList.Handle;
                }
                if ( win32.SendMessage( _rebar.Handle,
                    (int)win32.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 ));
                    }
                }
            }
        }