
 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

