[API]
Public WNDCLASSEX
UnregisterClassA
UnregisterClassW
RegisterClassExA
RegisterClassExW

[INCLUDE]
LocalAllocFromString

[CODE]
Public Function RegisterClassEx(pcWndClassEx As WNDCLASSEX) As Boolean
  pcWndClassEx.Reserved_lpszClassName = LocalAllocFromString(pcWndClassEx.ClassName)
  pcWndClassEx.cbSize = 48&
  pcWndClassEx.hInstance = App.hInstance
  
  If Not pcWndClassEx.Reserved_lpszClassName = 0& Then
    If IsUnicode Then
      RegisterClassEx = Not (RegisterClassExW(pcWndClassEx) = 0&)
      Else
      RegisterClassEx = Not (RegisterClassExA(pcWndClassEx) = 0&)
      End If
    LocalFree pcWndClassEx.Reserved_lpszClassName
    End If
  End Function

Public Sub UnregisterClass(ByVal lpClassName As String)
  If IsUnicode Then
    Call UnregisterClassW(StrPtr(lpClassName), App.hInstance)
    Else
    Call UnregisterClassA(lpClassName, App.hInstance)
    End If
  End Sub

