C# (CSharp) AdvancedLauncher.Tools.Win32.User32 HWND - 30 examples found. These are the top rated real world C# (CSharp) examples of AdvancedLauncher.Tools.Win32.User32.HWND extracted from open source projects. You can rate examples to help us improve the quality of examples.
HWNDs have very loose ownership semantics. Unlike normal handles, there is no "CloseHandle" API for HWNDs. There are APIs like CloseWindow or DestroyWindow, but these actually affect the window, not just your handle to the window. This SafeHandle type does not actually do anything to release the handle in the finalizer, it simply provides type safety to the PInvoke signatures. The StrongHWND SafeHandle will actually destroy the HWND when it is disposed or finalized. Because of this loose ownership semantic, the same HWND value can be returned from multiple APIs and can be directly compared. Since SafeHandles are actually reference types, we have to override all of the comparison methods and operators. We also support equality between null and HWND(IntPtr.Zero).