Пример #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);
 }
Пример #6
0
 private void ReleaseUnmanagedResources()
 {
     UnmanagedMethods.DestroyWindow(Handle);
     UnmanagedMethods.UnregisterClass(_className, UnmanagedMethods.GetModuleHandle(null));
 }