
 1. About

 DUSER32 "emulates" USER32. This emulation is very limited, but should work
 for simple window objects used by DirectDraw, OpenGL or SDL.

 The final goal is to support the following parts of the API:

 part                status
 ------------------------------------------------------
 char helper         ok
 clipboard           ok
 keyboard            ok
 menus               dummy
 messages            ok
 rectangles          ok
 windows             75% implemented


 2. Supported Functions

 Please note that if a function isn't marked as dummy it still may not work 
 as expected because it is only partially implemented.

 Name                       Dummy?
 ----------------------------------------------
 AdjustWindowRect
 AdjustWindowRectEx         Y
 AppendMenuA
 AppendMenuW
 BeginPaint
 BroadcastSystemMessage     Y
 BringWindowToTop
 CallNextHookEx             Y
 CallWindowProcA
 ChangeClipboardChain       Y
 ChangeDisplaySettingsA
 CharLowerA
 CharLowerW
 CharLowerBuffA
 CharLowerBuffW
 CharNextA
 CharNextExA
 CharNextW
 CharPrevA
 CharPrevExA
 CharPrevW
 CharToOemA
 CharToOemBuffA
 CharToOemBuffW
 CharToOemW
 CharUpperA
 CharUpperW
 CharUpperBuffA
 CharUpperBuffW
 CheckMenuItem              Y
 ChildWindowFromPoint
 ClientToScreen
 ClipCursor
 CloseClipboard
 CopyIcon                   Y
 CopyRect
 CountClipboardFormats
 CreateCursor
 CreateDialogParamA         Y
 CreateIcon                 Y
 CreateIconFromResource     Y
 CreateIconFromResourceEx   Y
 CreateIconIndirect         Y
 CreateMenu
 CreatePopupMenu
 CreateWindowExA
 DefWindowProcA
 DeleteMenu
 DestroyCursor
 DestroyIcon                Y
 DestroyMenu
 DestroyWindow
 DialogBoxIndirectParamA    Y
 DialogBoxParamA            Y
 DispatchMessageA
 DrawAnimatedRects          Y
 DrawFocusRect              Y
 DrawIcon                   Y
 DrawIconExA                Y
 DrawMenuBar                Y
 DrawTextA
 EmptyClipboard
 EnableWindow               Y
 EndDialog                  Y
 EndPaint
 EnumClipboardFormats
 EnumDisplayDevicesA        Y
 EnumDisplaySettingsA
 EnumThreadWindows
 EnumChildWindows
 EnumWindows
 ExitWindowsEx              Y
 FillRect
 FindWindowA
 FindWindowExA
 GetActiveWindow
 GetAsyncKeyState
 GetClassInfoA
 GetClassInfoW
 GetClassInfoExA
 GetClassInfoExW
 GetClassLongA
 GetClassLongW
 GetClassNameA
 GetClassNameW
 GetClientRect
 GetClipboardData
 GetClipboardFormatNameA
 GetClipboardOwner
 GetCursor
 GetCursorPos
 GetDC
 GetDesktopWindow           Y
 GetDlgItem                 Y
 GetDoubleClickTime
 GetFocus
 GetForegroundWindow
 GetIconInfo                Y
 GetKeyboardState
 GetKeyboardLayout
 GetKeyboardLayoutNameA     Y
 GetKeyboardType
 GetKeyNameTextA            Y
 GetKeyState
 GetLastActivePopup         Y
 GetMenu                    Y
 GetMenuItemCount           Y
 GetMenuItemID              Y
 GetMenuItemInfoA           Y
 GetMenuState               Y
 GetMenuStringA             Y
 GetMessageA
 GetMessageTime
 GetNextDlgTabItem          Y
 GetParent
 GetProcessWindowStation    Y
 GetQueueStatus             Y
 GetSubMenu                 Y
 GetSysColor                Y
 GetSysColorBrush
 GetSystemMenu
 GetSystemMetrics
 GetThreadDesktop           Y
 GetTitleBarInfo            Y
 GetTopWindow               Y
 GetUpdateRgn
 GetUserObjectInformationW  Y
 GetWindow                  Y
 GetWindowDC
 GetWindowLongA
 GetWindowPlacement
 GetWindowRect
 GetWindowRgn
 GetWindowTextA
 GetWindowTextLengthA
 GetWindowThreadProcessId
 GrayStringA                Y
 InflateRect
 InSendMessage              Y
 InsertMenuA
 IntersectRect
 InvalidateRect
 IsCharAlphaA
 IsCharAlphaW
 IsCharAlphaNumericA
 IsCharAlphaNumericW
 IsCharLowerA
 IsCharLowerW
 IsCharUpperA
 IsCharUpperW
 IsClipboardFormatAvailable
 IsDlgButtonChecked
 IsDialogMessageA
 IsIconic
 IsRectEmpty
 IsWindow
 IsZoomed
 KillTimer
 LoadBitmapA
 LoadCursorA
 LoadCursorW
 LoadIconA
 LoadImageA                 
 LoadKeyboardLayoutA        
 LoadMenuA                  Y
 LoadStringA
 LoadStringW
 MapVirtualKeyA
 MapVirtualKeyExA
 MapWindowPoints
 MessageBeep
 MessageBoxA
 MessageBoxExA
 MessageBoxIndirectA
 MessageBoxW
 ModifyMenuA                Y
 MoveWindow
 MsgWaitForMultipleObjects
 OemKeyScan
 OemToCharA
 OemToCharBuffA
 OemToCharBuffW
 OemToCharW
 OffsetRect
 OpenClipboard
 OpenIcon
 PeekMessageA
 PostMessageA
 PostQuitMessage
 PostThreadMessageA
 PtInRect
 RegisterClassA
 RegisterClassW
 RegisterClassExA
 RegisterClassExW
 RegisterClipboardFormatA
 RegisterHotKey
 RegisterWindowMessageA     Y
 ReleaseDC
 RemoveMenu                 Y
 ScreenToClient
 ScrollWindow
 ScrollWindowEx             Y
 SendDlgItemMessageA
 SendMessageA
 SendMessageW
 SetActiveWindow
 SetClassLongA
 SetClassLongW
 SetClipboardData
 SetClipboardViewer         Y
 SetCursorPos
 SetDlgItemTextA            Y
 SetDlgItemTextW            Y
 SetFocus
 SetForegroundWindow        Y
 SetKeyboardState           Y
 SetMenuDefaultItem         Y
 SetMenuItemInfoA           Y
 SetParent
 SetRect
 SetRectEmpty
 SetTimer
 SetWindowsHookExA          Y
 SetWindowLongA
 SetWindowPlacement
 SetWindowPos
 SetWindowRgn
 SetWindowTextA
 SetWindowTextW
 SetSysColors               Y
 ShowCursor
 ShowOwnedPopups            Y
 ShowWindow
 SystemParametersInfoA      Y
 SystemParametersInfoW      Y
 TabbedTextOut
 ToAscii
 ToAsciiEx
 ToUnicode
 TrackPopupMenu             Y
 TranslateMessage           Y
 UnhookWindowsHookEx        Y
 UnionRect
 UnregisterClassA
 UnregisterClassW
 UnregisterHotKey
 UpdateWindow
 ValidateRect
 VkKeyScanA                 Y
 WaitForInputIdle           Y
 WindowFromDC
 WindowFromPoint
 WinHelpA                   Y
 wsprintfA
 wvsprintfA


 3. History

 08/22/2011:  Version 2.14

  bugfix: GetWindowRect() did always return the non-maximized values.
  bugfix: GetWindowFromPoint() did always check the non-maximized values.
  bugfix: CharLowerA/W() worked just for letter 'A'.
  EnumDisplayDevicesA added.
  ScrollWindow added.
  GetLastInputInfo added (stub).
  WM_SYSCOMMAND, SC_MAXIMIZE is handled.
  WM_MOUSEWHEEL supported.
  SetScrollPos(), SetScrollRange() added (dummies).
  MapVirtualKeyA() now works with type=0.
  OemKeyScan added.
  SystemParametersInfoW, LoadCursorW, SetDlgItemTextW, AppendMenuW added.
  bugfix: RegisterClassW, FindWindowW destroyed contents of EBX register.

 11/16/2009:  Version 2.13

  GetProcessWindowStation, GetUserObjectInformationW, GetThreadDesktop
   added (dummies).
  BroadcastSystemMessage added (dummy)
  DrawAnimatedRects added (dummy).
  bugfix: keyboard was read even when no window had the input focus.
  GetWindowPlacement will accept a NULL wnd handle without GPF.
  VkKeyScanExA, GetKeyboardLayoutList added.
  ShowWindowAsync added.
  bugfix: value returned by GetKeyState had type DWORD, should be WORD.
  OW WRC now used as resource compiler (previously PORC).
  GetWindowInfo added.

 01/20/2009:  Version 2.12

  source assembled with JWasm.
  IsCharLowerA/W, IsCharUpperA/W added.
  Windows (NT/XP) clipboard supported.

 03/01/2008:  Version 2.11

  bugfix: CreateCursor didn't set top-down direction for cursor bitmap. 
  more Windows "standard" cursor resources added.
  cursor resource IDs made Windows compatible.
  IsCharAlphaW and IsCharAlphaNumericW added.

 01/11/2008:  Version 2.10

  bugfix: MessageBoxA ignored CR.
  MessageBoxA now uses TabbedTextOut for string output.
  TabbedTextOut implemented partially.
  if x or y parameter for CreateWindow is >= 8000h, it's now handled as if
   it's CW_USEDEFAULT.
  bugfix: OemToCharBuff stopped if a NULL character occured in the source.
  bugfix: in OemToCharBuffW, CharToOemBuffW, OemToCharW and CharToOemW
   the "Oem" pointer was handled like a pointer to a WORD.
  CreateWindowsExW, CallWindowProcW, DefWindowProcW, FindWindowW, 
   FindWindowExW, GetWindowLongW, GetWindowTextW, GetWindowTextLengthW,
   SetWindowLongW implemented.
  PostMessageW, PostThreadMessageW, DispatchMessageW, 
   PeekMessageW, GetMessageW, RegisterWindowMessageW added.
  RegisterClassW, RegisterClassExW, UnregisterClassW, GetClassLongW,
   SetClassLongW, GetClassInfoW, GetClassInfoExW, GetClassNameW added.
  SetWindowWord, GetWindowWord added
  DrawIcon added (dummy)
  AttachThreadInput added (dummy)
  GetShellWindow added (dummy)
  CopyAcceleratorTable added (dummy)
  WinHelpW added (dummy)
  IsWindowUnicode added
  CopyImage added (dummy)
  GetDialogBaseUnits added

 07/15/2007:  Version 2.9.13

  GetClassInfoA: if info for WC_DIALOG is requested, the 
   structure content is cleared, since some apps don't expect this
   call to fail. 
  GetClassInfoExA implemented.
  DefWindowProc changed to make it readable again.
  serialization now done with the help of a critical section, thus
   avoiding to disable interrupts.
  wsprintfW and wvsprintfW added.
  InvertRect added (dummy).
  GetMenuItemInfoA, SetMenuItemInfoA, TrackPopupMenu added (dummies).
  bugfix: DrawTextA did not calc the string length if count was -1,
   resulting in a GPF in GDI's TextOut() function.
  OpenIcon added.
  bugfix: LoadBitmap did not release a DC which was used temporarily.
  there is now an - empty - system menu returned by GetSystemMenu.
  EqualRect implemented.
  GetOpenClipboardWindow implemented (alias for GetClipboardOwner)
  bugfix: WindowFromPoint did ignore child windows.
  SystemParametersInfo: parameters SPI_GETWORKAREA and 
   SPI_GETSCREENSAVEACTIVE are known now.
  bugfix: implementation of IsChild() was wrong (lacking 2. parameter).
  the hwnd parameter of GetMessage/PeekMessage is no longer ignored.

 03/15/2007:  Version 2.9.12

  bugfix: SetMenu caused a GPF if hMenu was NULL.
  GetPriorityClipboardFormat added (dummy).
  CreatePopupMenu, ModifyMenuA, GetSubMenu, GetMenuItemCount,
   InsertMenuA, RemoveMenu, GetMenuStringA, SetMenuDefaultItem,
   SetMenuItemBitmaps, GetMenuCheckMarkDimensions added (dummies).
  EnumChildWindows added (dummy).
  SetWindowsHookExA, UnhookWindowsHookEx, CallNextHookEx added (dummies).
  GrayStringA added (dummy).
  GetNextDlgTabItem added (dummy).
  SetActiveWindow now checks if any window has the focus after WM_ACTIVATE
   msg has been sent. If no, SetFocus is called.
  EnumWindows, EnumThreadWindows, EnumChildWindows implemented.
  WindowFromDC changed to get the hwnd from the DC cache.
  GDI::RealizePalette now hooked by importing GDI:pfnRealizePalette.
  GDI32.DLL is statically imported now.
  WM_SIZE/WM_MOVE now also sent if window is maximized/restored.

 12/14/2006:  Version 2.9.11

  bugfix: RegisterClipboardFormatA didn't work.
  bugfix: EmptyClipboard deleted the registered clipboard formats.
  bugfix: WindowFromPoint didn't ignore disabled or hidden windows.
  bugfix: SetActiveWindow failed if hwnd parameter was a child window
   or NULL.
  MessageBoxIndirectA added.
  CreateMenu, DestroyMenu, AppendMenuA, DeleteMenu added (dummies).
  DrawMenuBar added (dummy).

 10/15/2006:  Version 2.9.10

  bugfix: GetMessagePos caused a GPF.
  bugfix: returning -1 when handling WM_CREATE didn't destroy window.
  bugfix: CreateWindowEx didn't accept an atom as class parameter.
  bugfix: SetMenu wasn't exported.
  MessageBoxA text output rendering improved, now a line wrap is
   done if size of a line exceeds 80 characters.
  SendDlgItemMessageA added.
  GetTitleBarInfo, IsDlgButtonChecked, LoadMenu added (dummies).
  GetWindowRgn, SetWindowRgn, GetUpdateRgn added.
  BringWindowToTop added.
  GetDoubleClickTime added.
  ShowOwnedPopups added (dummy).
  ChildWindowFromPoint added.
  ScrollWindowEx added (dummy).
  LockWindowUpdate added (dummy).

 09/14/2006:  Version 2.9.9

  bugfix: GetKeyboardState() set bit 6, not bit 7 of the key state.
  bugfix: in WM_KEYDOWN messages bit 29 of LPARAM wasn't set if ALT
   was pressed.
  SetClipboardViewer, ChangeClipboardChain added (dummies).
  GetClassInfoA implemented.
  IsRectEmpty added.

 08/15/2006:  Version 2.9.8

  RegisterHotkey partially implemented.
  GetDlgItemTextA, GetDlgItemInt, SetDlgItemInt added.

 07/15/2006:  Version 2.9.7

  wsprintfA supports %S format specifier.
  MapVirtualKeyExA, LoadKeyboardLayoutA, GetKeyboardLayoutNameA added.
  ValidateRgn + InvalidateRgn added.
  GetMessagePos added.
  SetParent, SetMenu, SetWindowTextW added.
  EnumClipboardFormats, CountClipboardFormats, GetClipboardFormatNameA,
   RegisterClipboardFormatA added.
  CopyIcon, DrawIconEx, GetIconInfo added (dummies).
  RedrawWindow added.

 06/14/2006:  Version 2.9.6

  bugfix: GetKeyboardLayout() caused wrong stack alignment.
  ValidateRect added.
  DUSER32 now uses Int 31h, ax=09xxh for serialization.
  UpdateWindow removes WM_PAINT messages from message queue.
  ToAsciiEx, ToUnicode added.
  WaitForInputIdle added (dummy).
  GetKeyNameTextA added (dummy).
  CreateIconIndirect added (dummy).
  MessageBoxW added.
  IsZoomed() now checks value of style bit WS_MAXIMIZE. Previously it 
   always returned TRUE.

 05/15/2006:  Version 2.9.5

  GetMessageTime added.
  GetClipboardOwner added.
  GetLastActivePopup added (dummy).
  CharNextW, CharPrevW added.
  SendMessageW added.

 04/21/2006:  Version 2.9.4

  LoadAcceleratorsA added.
  TranslateAcceleratorA added (dummy).

 03/26/2006:  Version 2.9.3

  Get/SetClassLong: some more values defined (GCL_HBRBACKGROUND, GCL_HCURSOR)

 03/08/2006:  Version 2.9.2

  MessageBox now handles multiple lines.
  GetKeyboardLayout added.
  FindWindowA, FindWindowExA added.
  GetSystemMetrics: SM_CMOUSEBUTTONS supported.
  DrawTextA added (dummy).
  class style CS_SAVEBITS supported.

 02/06/2006:  Version 2.9.1

  bugfix: GetWindowLong/SetWindowLong didn't work with offset 0.
  PostThreadMessageA no longer dummy.

 01/22/2006:  Version 2.9

  bugfix:calling ChangeDisplaySettings without a previous
   mode change failed.
  WM_SYSKEYDOWN/WM_SYSKEYUP/WM_SYSCHAR supported.
  MapVirtualKeyA now works with type=2 as well.
  keybd_event implemented.
  bugfix: GetWindowRect now accepts HWND_DESKTOP (=0) as hwnd.
  LoadIconA now looks in icon group resource.
  SetPropA, GetPropA, RemovePropA added (dummies).
  TranslateMessage, IsDialogMessageA implemented.

 01/02/2006:  Version 2.8

  DialogBoxIndirectParamA, GetDlgCtrlID added (dummies).
  WaitMessage added.
  GetClassNameA, GetWindowDC added.
  CloseWindow added.
  bugfix: WM_xBUTTONy had wrong WPARAM parameter.
  IsChild, GetClassLongA, IsWindowEnabled implemented.

 12/20/2005:  Version 2.7

  EnableWindow implemented (dummy).
  catch DestroyWindow(0) error.
  GetWindowPlacement, SetWindowPlacement added.
  DialogBoxParamA, EndDialog, GetDlgItem, SetDlgItemTextA, 
   CreateDialogParamA added (dummies).
  VkKeyScanA added (dummy).

 12/07/2005:  Version 2.6

  bugfix: wrong handling of WM_WINDOWPOSCHANGED in DefWindowProc.
  GetSysColor, SetSysColors added (dummies).
  RegisterHotkey, UnregisterHotkey added (dummies).
  RegisterWindowMessageA added.
  SystemParametersInfoA added (dummy).
  UpdateWindow, MoveWindow implemented.
  MessageBoxA now works in graphics mode (limited).
  GetSysColorBrush added.
  WNDCLASS.hbrBackground now supports system color indices.
  LoadIconA, CreateIconFromResource added.
  bugfix: SetWindowLong didn't return previous value.
  GetWindowThreadProcessId no longer dummy.
  MessageBox now waits for a key press.
  WindowFromDC added.
  GetClassInfoA added (dummy).
  GetQueueStatus added (dummy).
  InSendMessage added (dummy).

 11/24/2005:  Version 2.5

  WM_SETCURSOR handled in DefWindowProc.
  IsWindowVisible added.

 11/18/2005:  Version 2.4

  CopyRect, InflateRect, IntersectRect, OffsetRect, SetRect,
   SetRectEmpty, UnionRect added.

 11/04/2005:  Version 2.3

  DefWindowProc now handles WM_SYSCOMMAND/SC_CLOSE.
  bugfix: BeginPaint didn't send WM_ERASEBKGND if windows
   background has to be erased.
  bugfix: returncode of ShowWindow was always 1.
  bugfix: SetActiveWindow wasn't exported.
  bugfix: ChangeDisplaySettingsA didn't return an error code
   if DEVMODE.dmFields wasn't initialized.

 10/24/2005:  Version 2.2

  SetTimer, KillTimer no longer dummies.
  MsgWaitForMultipleObjects added.
  MapVirtualKeyA added.
  SetTimer, KillTimer added.
  PtInRect, LoadImageA added.
  ChangeDisplaySettingsA, EnumDisplaySettingsA added.
  ClientToScreen, ScreenToClient, AdjustWindowRect(Ex) added.
  GetWindowRect, GetClientRect, MapWindowPoints added.
  GetDesktopWindow, GetParent, GetMenu, WindowFromPoint added.
  SetClassLongA added.
  SetWindowTextA, IsZoomed, CallWindowProcA added.
  GetCapture, ReleaseCapture, SetCapture added.
  CreateIconFromResourceEx, DestroyIcon added.
  GetCurser, GetCursorPos, ClipCursor, SetCursorPos added.

 09/29/2005:  Version 2.1

  FillRect, InvalidateRect added.
  BeginPaint, EndPaint, GetDC, ReleaseDC added.

 09/18/2005:  Version 2.0

  LoadBitmapA added.
  SetWindowLongA, UnregisterClassA, CharLowerBuffW added.

 07/20/2005:  Version 1.9

  GetWindowTextLengthA added (dummy).

 07/06/2005:  Version 1.8

  IsClipboardFormatAvailable added.

 06/14/2005:  Version 1.7

  GetMessage/PeekMessage now receiving mouse messages.
  LoadCursor/DestroyCursor/SetCursor added.
  ShowCursor now shows/hides mouse cursor (SetConsoleMode).
  RegisterClassA + RegisterClassExA now maintain a linked
   list of registered classes.

 06/07/2005:  Version 1.6

  MessageBoxA + MessageBoxExA now write to console.
  GetFocus,SetFocus,RegisterClassExA added.

 05/20/2005:  Version 1.5

  CharPrevA, CharPrevExA added.

 12/03/2004:  Version 1.4

  CharToOemBuffW, CharToOemW.
  SetWindowPos added.
  EnumWindows (dummy).
  GetWindowTextA, GetWindow, GetWindowThreadProcessId added.
  GetForegroundWindow, SetForegroundWindow added.
  GetWindowLongA, GetTopWindow added.
  GetKeyboardState + SetKeyboardState added (dummy).
  MessageBoxExA, ToAscii, IsWindow added (dummy).

 11/25/2004:  Version 1.3

  CreateIcon + CreateCursor added (dummies).

 08/31/2004:  Version 1.2

  LoadStringW no longer dummy.

 08/29/2004:  Version 1.1

  ExitWindowsEx added (dummy).
  CharLowerBuffA added.
  GetKeyboardType added.
  IsCharAlphaNumericA added.
  CharNextExA added.
  MessageBeep added.

 02/01/2004:  Version 1.0


 4. Copyright

 DUSER32 is part of HX DOS extender. This extender is freeware.
 View HXRT.TXT for license details.

 Japheth

