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); }
public void Dispose() { if (_hwnd != IntPtr.Zero) { UnmanagedMethods.DestroyWindow(_hwnd); _hwnd = IntPtr.Zero; } if (_className != null) { UnmanagedMethods.UnregisterClass(_className, UnmanagedMethods.GetModuleHandle(null)); _className = null; } }
/// <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); }
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; } }
public void Dispose() { s_instances.Remove(this); UnmanagedMethods.DestroyWindow(_hwnd); }
private void ReleaseUnmanagedResources() { UnmanagedMethods.DestroyWindow(Handle); UnmanagedMethods.UnregisterClass(_className, UnmanagedMethods.GetModuleHandle(null)); }