
 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
 BeginPaint
 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
 DrawFocusRect              Y
 DrawIcon                   Y
 DrawIconExA                Y
 DrawMenuBar                Y
 DrawTextA
 EmptyClipboard
 EnableWindow               Y
 EndDialog                  Y
 EndPaint
 EnumClipboardFormats
 EnumDisplaySettingsA
 EnumThreadWindows
 EnumChildWindows
 EnumWindows
 ExitWindowsEx              Y
 FillRect
 FindWindowA
 FindWindowExA
 GetActiveWindow
 GetAsyncKeyState
 GetClassInfoA
 GetClassInfoExA
 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
 GetQueueStatus             Y
 GetSubMenu                 Y
 GetSysColor                Y
 GetSysColorBrush
 GetSystemMenu
 GetSystemMetrics
 GetTitleBarInfo            Y
 GetTopWindow               Y
 GetUpdateRgn
 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
 LoadIconA
 LoadImageA                 
 LoadKeyboardLayoutA        
 LoadMenuA                  Y
 LoadStringA
 LoadStringW
 MapVirtualKeyA
 MapVirtualKeyExA
 MapWindowPoints
 MessageBeep
 MessageBoxA
 MessageBoxExA
 MessageBoxIndirectA
 MessageBoxW
 ModifyMenuA                Y
 MoveWindow
 MsgWaitForMultipleObjects
 OemToCharA
 OemToCharBuffA
 OemToCharBuffW
 OemToCharW
 OffsetRect
 OpenClipboard
 OpenIcon
 PeekMessageA
 PostMessageA
 PostQuitMessage
 PostThreadMessageA
 PtInRect
 RegisterClassA
 RegisterClassExA
 RegisterClipboardFormatA
 RegisterHotKey
 RegisterWindowMessageA     Y
 ReleaseDC
 RemoveMenu                 Y
 ScreenToClient
 ScrollWindowEx             Y
 SendDlgItemMessageA
 SendMessageA
 SendMessageW
 SetActiveWindow
 SetClassLongA
 SetClipboardData
 SetClipboardViewer         Y
 SetCursorPos
 SetDlgItemTextA            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
 TabbedTextOut
 ToAscii
 ToAsciiEx
 ToUnicode
 TrackPopupMenu             Y
 TranslateMessage           Y
 UnhookWindowsHookEx        Y
 UnionRect
 UnregisterClassA
 UnregisterHotKey
 UpdateWindow
 ValidateRect
 VkKeyScanA                 Y
 WaitForInputIdle           Y
 WindowFromDC
 WindowFromPoint
 WinHelpA                   Y
 wsprintfA
 wvsprintfA


 3. History

 2009.01.20:  Version 2.12
 
  source assembled with JWasm.
  IsCharLowerA/W, IsCharUpperA/W added.
  Windows (NT/XP) clipboard supported.
 
 2008.03.01:  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.
 
 2008.01.11:  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
 
 2007.07.15:  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.
   
 
 2007.03.15:  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
 
 
 2006.12.14:  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)
 
 2006.10.15:  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)
 
 2006.09.14:  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
 
 2006.08.15:  Version 2.9.8
 
  RegisterHotkey partially implemented
  GetDlgItemTextA, GetDlgItemInt, SetDlgItemInt added 
 
 2006.07.15:  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
 
 2006.06.14:  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.
 
 2006.05.15:  Version 2.9.5
 
  GetMessageTime added
  GetClipboardOwner added
  GetLastActivePopup added (dummy)
  CharNextW, CharPrevW added
  SendMessageW added
 
 2006.04.21:  Version 2.9.4
 
  LoadAcceleratorsA added
  TranslateAcceleratorA added (dummy)
 
 2006.03.26:  Version 2.9.3
 
  Get/SetClassLong: some more values defined (GCL_HBRBACKGROUND, GCL_HCURSOR)
 
 2006.03.08:  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
 
 2006.02.06:  Version 2.9.1

  bugfix: GetWindowLong/SetWindowLong didn't work with offset 0.
  PostThreadMessageA no longer dummy
 
 2006.01.22:  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
 
 2006.01.02:  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
 
 2005.12.20:  Version 2.7
 
  EnableWindow implemented (dummy)
  catch DestroyWindow(0) error
  GetWindowPlacement, SetWindowPlacement added
  DialogBoxParamA, EndDialog, GetDlgItem, SetDlgItemTextA, 
   CreateDialogParamA added (dummies)
  VkKeyScanA added (dummy)
 
 2005.12.07:  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)
 
 2005.11.24:  Version 2.5
 
  WM_SETCURSOR handled in DefWindowProc
  IsWindowVisible added
 
 2005.11.18:  Version 2.4
 
  CopyRect, InflateRect, IntersectRect, OffsetRect, SetRect,
  SetRectEmpty, UnionRect added
              
 2005.11.04:  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.
              
 2005.10.24:  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
 
 2005.09.29:  Version 2.1
 
  FillRect, InvalidateRect added
  BeginPaint, EndPaint, GetDC, ReleaseDC added
 
 2005.09.18:  Version 2.0
 
  LoadBitmapA added
  SetWindowLongA, UnregisterClassA, CharLowerBuffW added
 
 2005.07.20:  Version 1.9
 
  GetWindowTextLengthA added (dummy)
 
 2005.07.06:  Version 1.8
 
  IsClipboardFormatAvailable added
 
 2005.06.14:  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.
              
 2005.06.07:  Version 1.6
 
  MessageBoxA + MessageBoxExA now write to console
  GetFocus,SetFocus,RegisterClassExA added
 
 2005.05.20:  Version 1.5
 
  CharPrevA, CharPrevExA added
 
 2004.12.03:  Version 1.4
 
  CharToOemBuffW, CharToOemW
  SetWindowPos
  EnumWindows (dummy)
  GetWindowTextA, GetWindow, GetWindowThreadProcessId added
  GetForegroundWindow, SetForegroundWindow added
  GetWindowLongA, GetTopWindow added
  GetKeyboardState + SetKeyboardState added (dummy)
  MessageBoxExA, ToAscii, IsWindow added (dummy)
 
 2004.11.25:  Version 1.3
 
  CreateIcon + CreateCursor added (dummies)
 
 2004.08.31:  Version 1.2
 
  LoadStringW no longer dummy
 
 2004.08.29:  Version 1.1
 
  ExitWindowsEx added (dummy)
  CharLowerBuffA added
  GetKeyboardType added
  IsCharAlphaNumericA added
  CharNextExA added
  MessageBeep added
 
 2004.02.01:  Version 1.0


 4. Copyright
 
 DUSER32 is part of HX DOS extender. This extender is freeware.
 View HXRT.TXT for licence details.
 
 Japheth
 
