Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than user32, prefix the name with the module name and a period.
UnregisterClass (user32)
.
C# Signature:
[DllImport("user32.dll")]
public static extern bool UnregisterClass(string lpClassName, IntPtr hInstance);
VB.NET Signature:
<DllImport("user32.dll")> _
Public Shared Function UnregisterClass(lpClassName As String, hInstance As IntPtr) As Boolean
End Function
VB Signature:
Declare Function unregisterClassEx Lib "user32.dll" (TODO) As TODO
User-Defined Types:
None.
Sample Code(VB.NET):
<StructLayout(LayoutKind.Sequential)> _
Private Structure WNDCLASSEX
Public cbSize As UInteger
Public style As ClassStyles
Public lpfnWndProc As IntPtr
Public cbClsExtra As Integer
Public cbWndExtra As Integer
Public hInstance As IntPtr
Public hIcon As IntPtr
Public hCursor As IntPtr
Public hbrBackground As IntPtr
Public lpszMenuName As String
Public lpszClassName As String
Public hIconSm As IntPtr
Shared Function MakeNew()
Dim nw As New WNDCLASSEX
nw.cbSize = Marshal.SizeOf(GetType(WNDCLASSEX))
Return nw
End Function
End Structure
<DllImport("user32.dll")> _
Private Shared Function RegisterClassEx(ByRef lpwcx As WNDCLASSEX) As Short
End Function
<DllImport("user32.dll")> _
Private Shared Function UnregisterClass(lpClassName As String, hInstance As IntPtr) As Boolean
End Function
Dim className As String = "Iranian_Persian_Class"
Dim WndClass As WNDCLASSEX = WNDCLASSEX.MakeNew()
With WndClass
.style = 0
.lpfnWndProc = IntPtr.Zero
.cbClsExtra = 0
.cbWndExtra = 0
.hInstance = IntPtr.Zero
.hIcon = IntPtr.Zero
.hCursor = IntPtr.Zero
.hbrBackground = IntPtr.Zero
.lpszMenuName = ""
.lpszClassName = className
.hIconSm = IntPtr.Zero
End With
If UnregisterClass(WndClass.lpszClassName, WndClass.hInstance) Then
MsgBox("Unregister Class Sucessfuly")
Else
MsgBox("Unregister Class Failed")
End If
End If
Alternative Managed API:
Do you know one? Please contribute it!
Notes:
Important. First destroy the window than call UnregisterClass!!
Tips & Tricks:
Please add some!
Sample Code:
Please add some!
TODO - a short description
8/2/2018 2:46:21 AM - -37.201.242.110
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).