示例#1
0
        public override void Dispose()
        {
            if (this.Handle != IntPtr.Zero)
            {
                UnmanagedMethods.DestroyWindow(this.Handle);
                UnmanagedMethods.UnregisterClass(this.className, IntPtr.Zero);
                this.Handle = IntPtr.Zero;
            }

            GC.SuppressFinalize(this);
        }
示例#2
0
 public void Dispose()
 {
     if (_hwnd != IntPtr.Zero)
     {
         UnmanagedMethods.DestroyWindow(_hwnd);
         _hwnd = IntPtr.Zero;
     }
     if (_className != null)
     {
         UnmanagedMethods.UnregisterClass(_className, UnmanagedMethods.GetModuleHandle(null));
         _className = null;
     }
 }
示例#3
0
        /// <summary>
        /// This function will receive all the system window messages relevant to our window.
        /// </summary>
        protected virtual IntPtr WndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
        {
            switch (msg)
            {
            case (uint)UnmanagedMethods.WindowsMessage.WM_CLOSE:
                UnmanagedMethods.DestroyWindow(hWnd);
                break;

            case (uint)UnmanagedMethods.WindowsMessage.WM_DESTROY:
                UnmanagedMethods.PostQuitMessage(0);
                break;

            default:
                return(UnmanagedMethods.DefWindowProc(hWnd, msg, wParam, lParam));
            }
            return(IntPtr.Zero);
        }
示例#4
0
 public void Dispose()
 {
     //if (_dropTarget != null)
     //{
     //    OleContext.Current?.UnregisterDragDrop(Handle);
     //    _dropTarget = null;
     //}
     if (_hwnd != IntPtr.Zero)
     {
         UnmanagedMethods.DestroyWindow(_hwnd);
         _hwnd = IntPtr.Zero;
     }
     if (_className != null)
     {
         UnmanagedMethods.UnregisterClass(_className, UnmanagedMethods.GetModuleHandle(null));
         _className = null;
     }
 }
示例#5
0
 public void Dispose()
 {
     s_instances.Remove(this);
     UnmanagedMethods.DestroyWindow(_hwnd);
 }
 private void ReleaseUnmanagedResources()
 {
     UnmanagedMethods.DestroyWindow(Handle);
     UnmanagedMethods.UnregisterClass(_className, UnmanagedMethods.GetModuleHandle(null));
 }