User32DestroyWindow(IntPtr) Method
Destroys the specified window.
The function sends
WM_Destroy and
WM_NcDestroy messages to the window
to deactivate it and remove the keyboard focus from it.
The function also destroys the window's menu, flushes the thread message queue, destroys timers,
removes clipboard ownership, and breaks the clipboard viewer chain (if the window is at the top of the viewer chain).
If the specified window is a parent or owner window,
DestroyWindow(IntPtr) automatically destroys the associated child or owned windows when
it destroys the parent or owner window.
The function first destroys child or owned windows, and then it destroys the parent or owner window.
DestroyWindow(IntPtr) also destroys modeless dialog boxes created by the
CreateDialog function.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", CallingConvention = CallingConvention.StdCall,
SetLastError = true)]
public static IntPtr DestroyWindow(
IntPtr hWnd
)
<DllImportAttribute("User32.dll", CallingConvention := CallingConvention.StdCall,
SetLastError := true>]
Public Shared Function DestroyWindow (
hWnd As IntPtr
) As IntPtr
Dim hWnd As IntPtr
Dim returnValue As IntPtr
returnValue = User32.DestroyWindow(hWnd)
public:
[DllImportAttribute(L"User32.dll", CallingConvention = CallingConvention::StdCall,
SetLastError = true)]
static IntPtr DestroyWindow(
IntPtr hWnd
)
[<DllImportAttribute("User32.dll", CallingConvention = CallingConvention.StdCall,
SetLastError = true)>]
static member DestroyWindow :
hWnd : IntPtr -> IntPtr
No code example is currently available or this language may not be supported.
- hWnd IntPtr
-
A handle to the window to be destroyed.
IntPtr
If the function succeeds, the return value is
Zero.
If the function fails, the return value is equal to a handle to the local memory object.
To get extended error information, call
GetLastWin32Error.