 ! FUNCTION: GetCursorPos
 FUNCTION: HDC GetDC ( HWND hWnd ) ;
 FUNCTION: HDC GetDCEx ( HWND hWnd, HRGN hrgnClip, DWORD flags ) ;
-! FUNCTION: GetDesktopWindow
+FUNCTION: HWND GetDesktopWindow ( ) ;
 ! FUNCTION: GetDialogBaseUnits
 ! FUNCTION: GetDlgCtrlID
 ! FUNCTION: GetDlgItem

! FUNCTION: SetWindowPlacement
FUNCTION: BOOL SetWindowPos ( HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags ) ;

: HWND_BOTTOM ( -- alien ) 1 <alien> ;
: HWND_NOTOPMOST ( -- alien ) -2 <alien> ;
CONSTANT: HWND_TOP f

    { dwType  DWORD  } ;
TYPEDEF: RAWINPUTDEVICELIST* PRAWINPUTDEVICELIST

CONSTANT: CCHFORMNAME 32

CONSTANT: CDS_UPDATEREGISTRY      HEX: 00000001
CONSTANT: CDS_TEST                HEX: 00000002
CONSTANT: CDS_FULLSCREEN          HEX: 00000004
CONSTANT: CDS_GLOBAL              HEX: 00000008
CONSTANT: CDS_SET_PRIMARY         HEX: 00000010
CONSTANT: CDS_RESET               HEX: 40000000
CONSTANT: CDS_SETRECT             HEX: 20000000
CONSTANT: CDS_NORESET             HEX: 10000000

CONSTANT: DISP_CHANGE_SUCCESSFUL 0
CONSTANT: DISP_CHANGE_RESTART 1
CONSTANT: DISP_CHANGE_FAILED     -1
CONSTANT: DISP_CHANGE_BADMODE    -2
CONSTANT: DISP_CHANGE_NOTUPDATED -3
CONSTANT: DISP_CHANGE_BADFLAGS   -4
CONSTANT: DISP_CHANGE_BADPARAM   -5



STRUCT: DEVMODE
    { dmDeviceName TCHAR[CCHDEVICENAME] }
    { dmSpecVersion WORD }
    { dmDriverVersion WORD }
    { dmSize WORD }
    { dmDriverExtra WORD }
    { dmFields DWORD }

    { dmOrientation short }
    { dmPaperSize short }
    { dmPaperLength short }
    { dmPaperWidth short }
    { dmScale short }
    { dmCopies short }
    { dmDefaultSource short }
    { dmPrintQuality short }

    { dmColor short }
    { dmDuplex short }
    { dmYResolution short }
    { dmTTOption short }
    { dmCollate short }
    { dmFormName TCHAR[CCHFORMNAME] }
    { dmLogPixels WORD }
    { dmBitsPerPel DWORD }
    { dmPelsWidth DWORD }
    { dmPelsHeight DWORD }
    { dmDisplayFlags DWORD }
    { dmDisplayFrequency DWORD }
    { dmiCMMethod DWORD }
    { dmICMIntent DWORD }

    { dmMediaType DWORD }
    { dmDitherType DWORD }
    { dmReserved1 DWORD }
    { dmReserved2 DWORD }
    { dmPanningWidth DWORD } ;

! union { DWORD dmDisplayFlags; DWORD dmNup; } ;
  ! union {
    ! struct {
      ! short dmOrientation;
      ! short dmPaperSize;
      ! short dmPaperLength;
      ! short dmPaperWidth;
      ! short dmScale;
      ! short dmCopies;
      ! short dmDefaultSource;
      ! short dmPrintQuality;
    ! } ;
    ! struct {
      ! POINTL dmPosition;
      ! DWORD dmDisplayOrientation;
      ! DWORD dmDisplayFixedOutput;
    ! } ;
  ! } ;

TYPEDEF: DEVMODE* PDEVMODE
TYPEDEF: DEVMODE* LPDEVMODE

LIBRARY: user32

FUNCTION: HKL ActivateKeyboardLayout ( HKL hkl, UINT Flags ) ;
