#ifndef _WINDOWS_H_
#define _WINDOWS_H_

#include <dos/dos.h>

//#include <intuition/IntuitionBase.h>
#include <intuition/intuition.h>
#include <intuition/icclass.h>
#include <intuition/imageclass.h>

#include <datatypes/datatypesclass.h>
#include <datatypes/pictureclass.h>

#include <libraries/amigaguide.h>
#include <libraries/gadtools.h>
#include <libraries/locale.h>

#include <graphics/gfxmacros.h>

#include <workbench/icon.h>

#include <clib/exec_protos.h>
#include <clib/dos_protos.h>
#include <clib/intuition_protos.h>
#include <clib/asl_protos.h>
#include <clib/graphics_protos.h>
#include <clib/gadtools_protos.h>
#include <clib/layers_protos.h>
#include <clib/amigaguide_protos.h>
#include <clib/datatypes_protos.h>
#include <clib/utility_protos.h>
#include <clib/alib_protos.h>
#include <clib/icon_protos.h>
#include <clib/locale_protos.h>

#include <proto/Warp3D.h>

#include <cybergraphx/cybergraphics.h>
#include <proto/cybergraphics.h>

#include "catalog.h"

typedef int DDCAPS;
typedef float FLOAT;
typedef unsigned int DWORD;
typedef long LONG;
typedef void *LPVOID;
typedef short SHORT;
typedef int HRESULT;
typedef char TCHAR;
typedef char D3DDEVICEDESC7;
typedef BitMap *HBITMAP;
typedef RastPort DC;
typedef DC *HDC;
typedef char HBRUSH;
typedef char HFONT;
typedef Screen * HINSTANCE;
typedef char LPDIRECT3D7;
typedef char LPDIRECTDRAWSURFACE7;
typedef char LPDDSURFACEDESC;
typedef short HANDLE;
typedef char GUID;
typedef Window * HWND;
typedef char LRESULT;
typedef unsigned int UINT;
typedef UINT WPARAM;
typedef long LPARAM;
typedef char *LPSTR;
typedef int MSG;
typedef char *HKEY;
typedef int HPEN;
typedef Menu *HMENU;
typedef Point POINT;
typedef char *LPCTSTR;
typedef BOOL (*DLGPROC) (HWND, UINT, WPARAM, LPARAM);
typedef Object GDIOBJ;
typedef GDIOBJ *HGDIOBJ;

#define inline
#define FAILED(a) (a)

#define max(a,b) (a>b?a:b)
#define min(a,b) (a>b?b:a)
#define S_OK 0
#define E_FAIL 1
#define CALLBACK
#define TRUE 1
#define FALSE 0
#define APIENTRY
#define WINAPI
#define DDPF_ZBUFFER 0
#include <string.h>
#define ZeroMemory(a,b) memset(a,0, b)
#define _T(a) a
#define HKEY_LOCAL_MACHINE "sk.ini"
#define KEY_READ 1
LONG RegOpenKeyEx(char *s, char *, int, int, char **);
LONG RegQueryValueEx(HKEY, char *, int, DWORD *, char *, DWORD *);
VOID RegCloseKey(HKEY);
#define lstrcat strcat
#define ERROR_SUCCESS 0
// #define FLT_MAX 1.0e10f
#define E_INVALIDARG 1
#define cosf cos
#define sinf sin
#define acosf acos
#define sqrtf sqrt
#define wsprintf sprintf
#define OutputDebugString printf
#define DDENUMRET_CANCEL 1
#define DDENUMRET_OK 0
#define SUCCEEDED(a) (a)

#define MB_OK                       0x00000000L
#define MB_OKCANCEL                 0x00000001L
#define MB_ABORTRETRYIGNORE         0x00000002L
#define MB_YESNOCANCEL              0x00000003L
#define MB_YESNO                    0x00000004L
#define MB_RETRYCANCEL              0x00000005L
#define MB_ICONHAND                 0x00000010L
#define MB_ICONQUESTION             0x00000020L
#define MB_ICONEXCLAMATION          0x00000030L
#define MB_ICONASTERISK             0x00000040L
#define MB_USERICON                 0x00000080L
#define MB_ICONWARNING              MB_ICONEXCLAMATION
#define MB_ICONERROR                MB_ICONHAND
#define MB_ICONINFORMATION          MB_ICONASTERISK
#define MB_ICONSTOP                 MB_ICONHAND
#define MB_DEFBUTTON1               0x00000000L
#define MB_DEFBUTTON2               0x00000100L
#define MB_DEFBUTTON3               0x00000200L
#define MB_DEFBUTTON4               0x00000300L
#define MB_APPLMODAL                0x00000000L
#define MB_SYSTEMMODAL              0x00001000L
#define MB_TASKMODAL                0x00002000L
#define MB_HELP                     0x00004000L
#define MB_NOFOCUS                  0x00008000L
#define MB_SETFOREGROUND            0x00010000L
#define MB_DEFAULT_DESKTOP_ONLY     0x00020000L
#define MB_TOPMOST                  0x00040000L
#define MB_RIGHT                    0x00080000L
#define MB_RTLREADING               0x00100000L
#define MB_SERVICE_NOTIFICATION          0x00200000L
#define MB_SERVICE_NOTIFICATION_NT3X     0x00040000L
#define MB_TYPEMASK                 0x0000000FL
#define MB_ICONMASK                 0x000000F0L
#define MB_DEFMASK                  0x00000F00L
#define MB_MODEMASK                 0x00003000L
#define MB_MISCMASK                 0x0000C000L

#define MF_INSERT           0x00000000L
#define MF_CHANGE           0x00000080L
#define MF_APPEND           0x00000100L
#define MF_DELETE           0x00000200L
#define MF_REMOVE           0x00001000L
#define MF_BYCOMMAND        0x00000000L
#define MF_BYPOSITION       0x00000400L
#define MF_SEPARATOR        0x00000800L
#define MF_ENABLED          0x00000000L
#define MF_GRAYED           0x00000001L
#define MF_DISABLED         0x00000002L
#define MF_UNCHECKED        0x00000000L
#define MF_CHECKED          0x00000008L
#define MF_USECHECKBITMAPS  0x00000200L
#define MF_STRING           0x00000000L
#define MF_BITMAP           0x00000004L
#define MF_OWNERDRAW        0x00000100L
#define MF_POPUP            0x00000010L
#define MF_MENUBARBREAK     0x00000020L
#define MF_MENUBREAK        0x00000040L
#define MF_UNHILITE         0x00000000L
#define MF_HILITE           0x00000080L
#define MF_DEFAULT          0x00001000L
#define MF_SYSMENU          0x00002000L
#define MF_HELP             0x00004000L
#define MF_RIGHTJUSTIFY     0x00004000L
#define MF_MOUSESELECT      0x00008000L
#define MF_END              0x00000080L  /* Obsolete -- only used by old RES files */

#define MFT_STRING          MF_STRING
#define MFT_BITMAP          MF_BITMAP
#define MFT_MENUBARBREAK    MF_MENUBARBREAK
#define MFT_MENUBREAK       MF_MENUBREAK
#define MFT_OWNERDRAW       MF_OWNERDRAW
#define MFT_RADIOCHECK      0x00000200L
#define MFT_SEPARATOR       MF_SEPARATOR
#define MFT_RIGHTORDER      0x00002000L
#define MFT_RIGHTJUSTIFY    MF_RIGHTJUSTIFY

#define MFS_GRAYED          0x00000003L
#define MFS_DISABLED        MFS_GRAYED
#define MFS_CHECKED         MF_CHECKED
#define MFS_HILITE          MF_HILITE
#define MFS_ENABLED         MF_ENABLED
#define MFS_UNCHECKED       MF_UNCHECKED
#define MFS_UNHILITE        MF_UNHILITE
#define MFS_DEFAULT         MF_DEFAULT
#define MFS_MASK            0x0000108BL
#define MFS_HOTTRACKDRAWN   0x10000000L
#define MFS_CACHEDBMP       0x20000000L
#define MFS_BOTTOMGAPDROP   0x40000000L
#define MFS_TOPGAPDROP      0x80000000L
#define MFS_GAPDROP         0xC0000000L

#define SC_SIZE         0xF000
#define SC_MOVE         0xF010
#define SC_MINIMIZE     0xF020
#define SC_MAXIMIZE     0xF030
#define SC_NEXTWINDOW   0xF040
#define SC_PREVWINDOW   0xF050
#define SC_CLOSE        0xF060
#define SC_VSCROLL      0xF070
#define SC_HSCROLL      0xF080
#define SC_MOUSEMENU    0xF090
#define SC_KEYMENU      0xF100
#define SC_ARRANGE      0xF110
#define SC_RESTORE      0xF120
#define SC_TASKLIST     0xF130
#define SC_SCREENSAVE   0xF140
#define SC_HOTKEY       0xF150
#define SC_DEFAULT      0xF160
#define SC_MONITORPOWER 0xF170
#define SC_CONTEXTHELP  0xF180
#define SC_SEPARATOR    0xF00F
#define SC_ICON         SC_MINIMIZE
#define SC_ZOOM         SC_MAXIMIZE

#define IDC_ARROW           MAKEINTRESOURCE(32512)
#define IDC_IBEAM           MAKEINTRESOURCE(32513)
#define IDC_WAIT            MAKEINTRESOURCE(32514)
#define IDC_CROSS           MAKEINTRESOURCE(32515)
#define IDC_UPARROW         MAKEINTRESOURCE(32516)
#define IDC_SIZE            MAKEINTRESOURCE(32640) /* OBSOLETE: use IDC_SIZEALL */
#define IDC_ICON            MAKEINTRESOURCE(32641) /* OBSOLETE: use IDC_ARROW */
#define IDC_SIZENWSE        MAKEINTRESOURCE(32642)
#define IDC_SIZENESW        MAKEINTRESOURCE(32643)
#define IDC_SIZEWE          MAKEINTRESOURCE(32644)
#define IDC_SIZENS          MAKEINTRESOURCE(32645)
#define IDC_SIZEALL         MAKEINTRESOURCE(32646)
#define IDC_NO              MAKEINTRESOURCE(32648) /* not in win3.1 */
#define IDC_HAND            MAKEINTRESOURCE(32649)
#define IDC_APPSTARTING     MAKEINTRESOURCE(32650) /* not in win3.1 */
#define IDC_HELP            MAKEINTRESOURCE(32651)

#define IMAGE_BITMAP        0
#define IMAGE_ICON          1
#define IMAGE_CURSOR        2
#define IMAGE_ENHMETAFILE   3

#define LR_DEFAULTCOLOR     0x0000
#define LR_MONOCHROME       0x0001
#define LR_COLOR            0x0002
#define LR_COPYRETURNORG    0x0004
#define LR_COPYDELETEORG    0x0008
#define LR_LOADFROMFILE     0x0010
#define LR_LOADTRANSPARENT  0x0020
#define LR_DEFAULTSIZE      0x0040
#define LR_VGACOLOR         0x0080
#define LR_LOADMAP3DCOLORS  0x1000
#define LR_CREATEDIBSECTION 0x2000
#define LR_COPYFROMRESOURCE 0x4000
#define LR_SHARED           0x8000

#define DI_MASK         0x0001
#define DI_IMAGE        0x0002
#define DI_NORMAL       0x0003
#define DI_COMPAT       0x0004
#define DI_DEFAULTSIZE  0x0008

#define IDI_APPLICATION     32512
#define IDI_HAND            32513
#define IDI_QUESTION        32514
#define IDI_EXCLAMATION     32515
#define IDI_ASTERISK        32516
#define IDI_WINLOGO         32517
#define IDI_WARNING			IDI_EXCLAMATION
#define IDI_ERROR			IDI_HAND
#define IDI_INFORMATION		IDI_ASTERISK

#define IDOK                1
#define IDCANCEL            2
#define IDABORT             3
#define IDRETRY             4
#define IDIGNORE            5
#define IDYES               6
#define IDNO                7
#define IDCLOSE				8
#define IDHELP				9

#define ES_LEFT             0x0000L
#define ES_CENTER           0x0001L
#define ES_RIGHT            0x0002L
#define ES_MULTILINE        0x0004L
#define ES_UPPERCASE        0x0008L
#define ES_LOWERCASE        0x0010L
#define ES_PASSWORD         0x0020L
#define ES_AUTOVSCROLL      0x0040L
#define ES_AUTOHSCROLL      0x0080L
#define ES_NOHIDESEL        0x0100L
#define ES_OEMCONVERT       0x0400L
#define ES_READONLY         0x0800L
#define ES_WANTRETURN       0x1000L
#define ES_NUMBER           0x2000L

#define EN_SETFOCUS         0x0100
#define EN_KILLFOCUS        0x0200
#define EN_CHANGE           0x0300
#define EN_UPDATE           0x0400
#define EN_ERRSPACE         0x0500
#define EN_MAXTEXT          0x0501
#define EN_HSCROLL          0x0601
#define EN_VSCROLL          0x0602

#define EC_LEFTMARGIN       0x0001
#define EC_RIGHTMARGIN      0x0002
#define EC_USEFONTINFO      0xffff

#define EMSIS_COMPOSITIONSTRING        0x0001

#define EIMES_GETCOMPSTRATONCE         0x0001
#define EIMES_CANCELCOMPSTRINFOCUS     0x0002
#define EIMES_COMPLETECOMPSTRKILLFOCUS 0x0004

#define EM_GETSEL               0x00B0
#define EM_SETSEL               0x00B1
#define EM_GETRECT              0x00B2
#define EM_SETRECT              0x00B3
#define EM_SETRECTNP            0x00B4
#define EM_SCROLL               0x00B5
#define EM_LINESCROLL           0x00B6
#define EM_SCROLLCARET          0x00B7
#define EM_GETMODIFY            0x00B8
#define EM_SETMODIFY            0x00B9
#define EM_GETLINECOUNT         0x00BA
#define EM_LINEINDEX            0x00BB
#define EM_SETHANDLE            0x00BC
#define EM_GETHANDLE            0x00BD
#define EM_GETTHUMB             0x00BE
#define EM_LINELENGTH           0x00C1
#define EM_REPLACESEL           0x00C2
#define EM_GETLINE              0x00C4
#define EM_LIMITTEXT            0x00C5
#define EM_CANUNDO              0x00C6
#define EM_UNDO                 0x00C7
#define EM_FMTLINES             0x00C8
#define EM_LINEFROMCHAR         0x00C9
#define EM_SETTABSTOPS          0x00CB
#define EM_SETPASSWORDCHAR      0x00CC
#define EM_EMPTYUNDOBUFFER      0x00CD
#define EM_GETFIRSTVISIBLELINE  0x00CE
#define EM_SETREADONLY          0x00CF
#define EM_SETWORDBREAKPROC     0x00D0
#define EM_GETWORDBREAKPROC     0x00D1
#define EM_GETPASSWORDCHAR      0x00D2
#define EM_SETMARGINS           0x00D3
#define EM_GETMARGINS           0x00D4
#define EM_SETLIMITTEXT         EM_LIMITTEXT
#define EM_GETLIMITTEXT         0x00D5
#define EM_POSFROMCHAR          0x00D6
#define EM_CHARFROMPOS          0x00D7
#define EM_SETIMESTATUS         0x00D8
#define EM_GETIMESTATUS         0x00D9

#define WB_LEFT            0
#define WB_RIGHT           1
#define WB_ISDELIMITER     2

#define BS_PUSHBUTTON       0x00000000L
#define BS_DEFPUSHBUTTON    0x00000001L
#define BS_CHECKBOX         0x00000002L
#define BS_AUTOCHECKBOX     0x00000003L
#define BS_RADIOBUTTON      0x00000004L
#define BS_3STATE           0x00000005L
#define BS_AUTO3STATE       0x00000006L
#define BS_GROUPBOX         0x00000007L
#define BS_USERBUTTON       0x00000008L
#define BS_AUTORADIOBUTTON  0x00000009L
#define BS_OWNERDRAW        0x0000000BL
#define BS_LEFTTEXT         0x00000020L
#define BS_TEXT             0x00000000L
#define BS_ICON             0x00000040L
#define BS_BITMAP           0x00000080L
#define BS_LEFT             0x00000100L
#define BS_RIGHT            0x00000200L
#define BS_CENTER           0x00000300L
#define BS_TOP              0x00000400L
#define BS_BOTTOM           0x00000800L
#define BS_VCENTER          0x00000C00L
#define BS_PUSHLIKE         0x00001000L
#define BS_MULTILINE        0x00002000L
#define BS_NOTIFY           0x00004000L
#define BS_FLAT             0x00008000L
#define BS_RIGHTBUTTON      BS_LEFTTEXT

#define BN_CLICKED          0
#define BN_PAINT            1
#define BN_HILITE           2
#define BN_UNHILITE         3
#define BN_DISABLE          4
#define BN_DOUBLECLICKED    5
#define BN_PUSHED           BN_HILITE
#define BN_UNPUSHED         BN_UNHILITE
#define BN_DBLCLK           BN_DOUBLECLICKED
#define BN_SETFOCUS         6
#define BN_KILLFOCUS        7

#define BM_GETCHECK        0x00F0
#define BM_SETCHECK        0x00F1
#define BM_GETSTATE        0x00F2
#define BM_SETSTATE        0x00F3
#define BM_SETSTYLE        0x00F4
#define BM_CLICK           0x00F5
#define BM_GETIMAGE        0x00F6
#define BM_SETIMAGE        0x00F7

#define BST_UNCHECKED      0x0000
#define BST_CHECKED        0x0001
#define BST_INDETERMINATE  0x0002
#define BST_PUSHED         0x0004
#define BST_FOCUS          0x0008

#define SS_LEFT             0x00000000L
#define SS_CENTER           0x00000001L
#define SS_RIGHT            0x00000002L
#define SS_ICON             0x00000003L
#define SS_BLACKRECT        0x00000004L
#define SS_GRAYRECT         0x00000005L
#define SS_WHITERECT        0x00000006L
#define SS_BLACKFRAME       0x00000007L
#define SS_GRAYFRAME        0x00000008L
#define SS_WHITEFRAME       0x00000009L
#define SS_USERITEM         0x0000000AL
#define SS_SIMPLE           0x0000000BL
#define SS_LEFTNOWORDWRAP   0x0000000CL
#define SS_OWNERDRAW        0x0000000DL
#define SS_BITMAP           0x0000000EL
#define SS_ENHMETAFILE      0x0000000FL
#define SS_ETCHEDHORZ       0x00000010L
#define SS_ETCHEDVERT       0x00000011L
#define SS_ETCHEDFRAME      0x00000012L
#define SS_TYPEMASK         0x0000001FL
#define SS_NOPREFIX         0x00000080L /* Don't do "&" character translation */
#define SS_NOTIFY           0x00000100L
#define SS_CENTERIMAGE      0x00000200L
#define SS_RIGHTJUST        0x00000400L
#define SS_REALSIZEIMAGE    0x00000800L
#define SS_SUNKEN           0x00001000L
#define SS_ENDELLIPSIS      0x00004000L
#define SS_PATHELLIPSIS     0x00008000L
#define SS_WORDELLIPSIS     0x0000C000L
#define SS_ELLIPSISMASK     0x0000C000L

#define STM_SETICON         0x0170
#define STM_GETICON         0x0171
#define STM_SETIMAGE        0x0172
#define STM_GETIMAGE        0x0173
#define STN_CLICKED         0
#define STN_DBLCLK          1
#define STN_ENABLE          2
#define STN_DISABLE         3
#define STM_MSGMAX          0x0174

#define WC_DIALOG       (MAKEINTATOM(0x8002))

#define DWL_MSGRESULT   0
#define DWL_DLGPROC     4
#define DWL_USER        8

#define LBN_ERRSPACE        (-2)
#define LBN_SELCHANGE       1
#define LBN_DBLCLK          2
#define LBN_SELCANCEL       3
#define LBN_SETFOCUS        4
#define LBN_KILLFOCUS       5

#define LB_CTLCODE          0L
#define LB_OKAY             0
#define LB_ERR              (-1)
#define LB_ERRSPACE         (-2)
#define LB_ADDSTRING            0x0180
#define LB_INSERTSTRING         0x0181
#define LB_DELETESTRING         0x0182
#define LB_SELITEMRANGEEX       0x0183
#define LB_RESETCONTENT         0x0184
#define LB_SETSEL               0x0185
#define LB_SETCURSEL            0x0186
#define LB_GETSEL               0x0187
#define LB_GETCURSEL            0x0188
#define LB_GETTEXT              0x0189
#define LB_GETTEXTLEN           0x018A
#define LB_GETCOUNT             0x018B
#define LB_SELECTSTRING         0x018C
#define LB_DIR                  0x018D
#define LB_GETTOPINDEX          0x018E
#define LB_FINDSTRING           0x018F
#define LB_GETSELCOUNT          0x0190
#define LB_GETSELITEMS          0x0191
#define LB_SETTABSTOPS          0x0192
#define LB_GETHORIZONTALEXTENT  0x0193
#define LB_SETHORIZONTALEXTENT  0x0194
#define LB_SETCOLUMNWIDTH       0x0195
#define LB_ADDFILE              0x0196
#define LB_SETTOPINDEX          0x0197
#define LB_GETITEMRECT          0x0198
#define LB_GETITEMDATA          0x0199
#define LB_SETITEMDATA          0x019A
#define LB_SELITEMRANGE         0x019B
#define LB_SETANCHORINDEX       0x019C
#define LB_GETANCHORINDEX       0x019D
#define LB_SETCARETINDEX        0x019E
#define LB_GETCARETINDEX        0x019F
#define LB_SETITEMHEIGHT        0x01A0
#define LB_GETITEMHEIGHT        0x01A1
#define LB_FINDSTRINGEXACT      0x01A2
#define LB_SETLOCALE            0x01A5
#define LB_GETLOCALE            0x01A6
#define LB_SETCOUNT             0x01A7
#define LB_INITSTORAGE          0x01A8
#define LB_ITEMFROMPOINT        0x01A9
#define LB_MSGMAX               0x01B0

#define LBS_NOTIFY            0x0001L
#define LBS_SORT              0x0002L
#define LBS_NOREDRAW          0x0004L
#define LBS_MULTIPLESEL       0x0008L
#define LBS_OWNERDRAWFIXED    0x0010L
#define LBS_OWNERDRAWVARIABLE 0x0020L
#define LBS_HASSTRINGS        0x0040L
#define LBS_USETABSTOPS       0x0080L
#define LBS_NOINTEGRALHEIGHT  0x0100L
#define LBS_MULTICOLUMN       0x0200L
#define LBS_WANTKEYBOARDINPUT 0x0400L
#define LBS_EXTENDEDSEL       0x0800L
#define LBS_DISABLENOSCROLL   0x1000L
#define LBS_NODATA            0x2000L
#define LBS_NOSEL             0x4000L
#define LBS_STANDARD          (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)

#define CBN_ERRSPACE        (-1)
#define CBN_SELCHANGE       1
#define CBN_DBLCLK          2
#define CBN_SETFOCUS        3
#define CBN_KILLFOCUS       4
#define CBN_EDITCHANGE      5
#define CBN_EDITUPDATE      6
#define CBN_DROPDOWN        7
#define CBN_CLOSEUP         8
#define CBN_SELENDOK        9
#define CBN_SELENDCANCEL    10

#define CBS_SIMPLE            0x0001L
#define CBS_DROPDOWN          0x0002L
#define CBS_DROPDOWNLIST      0x0003L
#define CBS_OWNERDRAWFIXED    0x0010L
#define CBS_OWNERDRAWVARIABLE 0x0020L
#define CBS_AUTOHSCROLL       0x0040L
#define CBS_OEMCONVERT        0x0080L
#define CBS_SORT              0x0100L
#define CBS_HASSTRINGS        0x0200L
#define CBS_NOINTEGRALHEIGHT  0x0400L
#define CBS_DISABLENOSCROLL   0x0800L
#define CBS_UPPERCASE           0x2000L
#define CBS_LOWERCASE           0x4000L

#define CB_OKAY             0
#define CB_ERR              (-1)
#define CB_ERRSPACE         (-2)
#define CB_GETEDITSEL               0x0140
#define CB_LIMITTEXT                0x0141
#define CB_SETEDITSEL               0x0142
#define CB_ADDSTRING                0x0143
#define CB_DELETESTRING             0x0144
#define CB_DIR                      0x0145
#define CB_GETCOUNT                 0x0146
#define CB_GETCURSEL                0x0147
#define CB_GETLBTEXT                0x0148
#define CB_GETLBTEXTLEN             0x0149
#define CB_INSERTSTRING             0x014A
#define CB_RESETCONTENT             0x014B
#define CB_FINDSTRING               0x014C
#define CB_SELECTSTRING             0x014D
#define CB_SETCURSEL                0x014E
#define CB_SHOWDROPDOWN             0x014F
#define CB_GETITEMDATA              0x0150
#define CB_SETITEMDATA              0x0151
#define CB_GETDROPPEDCONTROLRECT    0x0152
#define CB_SETITEMHEIGHT            0x0153
#define CB_GETITEMHEIGHT            0x0154
#define CB_SETEXTENDEDUI            0x0155
#define CB_GETEXTENDEDUI            0x0156
#define CB_GETDROPPEDSTATE          0x0157
#define CB_FINDSTRINGEXACT          0x0158
#define CB_SETLOCALE                0x0159
#define CB_GETLOCALE                0x015A
#define CB_GETTOPINDEX              0x015b
#define CB_SETTOPINDEX              0x015c
#define CB_GETHORIZONTALEXTENT      0x015d
#define CB_SETHORIZONTALEXTENT      0x015e
#define CB_GETDROPPEDWIDTH          0x015f
#define CB_SETDROPPEDWIDTH          0x0160
#define CB_INITSTORAGE              0x0161
#define CB_MSGMAX                   0x0162

#define SBS_HORZ                    0x0000L
#define SBS_VERT                    0x0001L
#define SBS_TOPALIGN                0x0002L
#define SBS_LEFTALIGN               0x0002L
#define SBS_BOTTOMALIGN             0x0004L
#define SBS_RIGHTALIGN              0x0004L
#define SBS_SIZEBOXTOPLEFTALIGN     0x0002L
#define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L
#define SBS_SIZEBOX                 0x0008L
#define SBS_SIZEGRIP                0x0010L

#define SBM_SETPOS                  0x00E0 /*not in win3.1 */
#define SBM_GETPOS                  0x00E1 /*not in win3.1 */
#define SBM_SETRANGE                0x00E2 /*not in win3.1 */
#define SBM_SETRANGEREDRAW          0x00E6 /*not in win3.1 */
#define SBM_GETRANGE                0x00E3 /*not in win3.1 */
#define SBM_ENABLE_ARROWS           0x00E4 /*not in win3.1 */
#define SBM_SETSCROLLINFO           0x00E9
#define SBM_GETSCROLLINFO           0x00EA
#define SB_CTL                      0x00EB

#define SIF_RANGE           0x0001
#define SIF_PAGE            0x0002
#define SIF_POS             0x0004
#define SIF_DISABLENOSCROLL 0x0008
#define SIF_TRACKPOS        0x0010
#define SIF_ALL             (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)

typedef struct
{
    UINT    cbSize;
    UINT    fMask;
    int     nMin;
    int     nMax;
    UINT    nPage;
    int     nPos;
    int     nTrackPos;
}   SCROLLINFO, *LPSCROLLINFO;

#define WM_CREATE	        1
#define WM_MOVE	            2
#define WM_PAINT	        3
#define WM_SIZE	            4
#define WM_CHAR	            5
#define WM_GETMINMAXINFO	6
#define WM_CLOSE	        7
#define WM_DESTROY	        8
#define WM_LBUTTONDOWN	    9
#define WM_MOUSEMOVE	    10
#define WM_LBUTTONDBLCLK	11
#define WM_COMMAND	        12
#define WM_LBUTTONUP        13
#define MK_BUTTON	        14
#define MK_SHIFT            15
#define MK_CONTROL          16
#define MK_RBUTTON          17
#define MK_MBUTTON          18
#define WM_DISPLAYCHANGE    19
#define WM_SETTEXT          20
#define WM_GETTEXT          21
#define WM_NCLBUTTONDBLCLK  22
#define WM_INITDIALOG       23
#define WM_HSCROLL          24
#define WM_USER             1024

#define RT_CURSOR       1
#define RT_BITMAP       2
#define RT_ICON         3
#define RT_MENU         4
#define RT_DIALOG       5
#define RT_STRING       6
#define RT_FONTDIR      7
#define RT_FONT         8
#define RT_ACCELERATOR  9
#define RT_RCDATA       10
#define RT_MESSAGETABLE 11
#define RT_GROUP_CURSOR 12
#define RT_GROUP_ICON   14
#define RT_VERSION      16
#define RT_DLGINCLUDE   17
#define RT_PLUGPLAY     19
#define RT_VXD          20
#define RT_ANICURSOR    21
#define RT_ANIICON      22
#define RT_HTML         23

#define SW_HIDE 0
#define SW_SHOWMAXIMIZED    1
#define SW_SHOWNA   2
#define SW_MAXIMIZE 3

#define MAKEINTRESOURCE(a) ((LPCTSTR) a)
#define GWL_USERDATA	2048
#define FW_BOLD 0
#define ANSI_CHARSET 0
#define OUT_DEFAULT_PRECIS 0
#define CLIP_DEFAULT_PRECIS 0
#define DEFAULT_QUALITY 0
#define VARIABLE_PITCH 0
#define TRANSPARENT 0
#define SRCCOPY 0
#define PS_SOLID 0
#define LOWORD(a) (a & 0xFFFF)
#define HIWORD(a) (a >> 16)
#define PAINTSTRUCT char
#define SIZE_MAXHIDE 0
#define SIZE_MINIMIZED 1
#define COLORREF D3DCOLOR
#define HORZRES 1
#define VERTRES 2
#define D3DX_DEFAULT 0
#define DDSD_CAPS 1
#define DDSCAPS_PRIMARYSURFACE 1
#define DDSCL_NORMAL 1
#define DDSD_WIDTH 1
#define DDSD_HEIGHT 2
#define DDSCAPS_OFFSCREENPLAIN 3
#define DDSCAPS_3DDEVICE 4
#define DDSD_PIXELFORMAT 5
#define DDSCAPS_ZBUFFER 6
#define DDSCAPS_VIDEOMEMORY 7
#define DDSCAPS_SYSTEMMEMORY 8
#define DS_SETFONT 0x40L

#define DeleteObject    ReleasePen

typedef struct
	{
		LONG left;
		LONG top;
        LONG right;
		LONG bottom;
	} RECT;  // Structure équivalente à Rect32 Amiga

typedef struct
	{
		int x;
		int y;
		POINT ptMinTrackSize;
	} MINMAXINFO;

typedef struct
	{
		DWORD dwCaps;
	} DDSURFACECAPS;

typedef struct
	{
		DWORD dwSize;
	} PIXELFORMAT;
	
typedef struct
	{
		DWORD dwSize;
		DWORD dwFlags;
		DDSURFACECAPS ddsCaps;
		PIXELFORMAT ddpfPixelFormat;
	} DDSURFACEDESC2;
		
typedef struct
	{
		DWORD dwFlags;
        DWORD dwZBufferBitDepth;
} DDPIXELFORMAT;
#define LPDDPIXELFORMAT DDPIXELFORMAT *

typedef struct
	{
		int *SetRenderState(int a, int b);
		int *SetTransform(int a, void *b);
		int *Clear(int a, int b, int c, int d, float e, int f);
		int *BeginScene(void);
		int *SetMaterial(void *a);
		int *DrawPrimitive(int a, int b, void *c, int d, int e);
		int *EndScene(void);
		int *SetLight(int a, void *b);
		int *LightEnable(int a, BOOL b);
        int QueryInterface(int, void *);
	} DIRECT3DDEVICE7;
#define LPDIRECT3DDEVICE7 DIRECT3DDEVICE7 *

typedef struct
	{
        int QueryInterface(int, void *);
        int SetCooperativeLevel(HWND, int);
	} DIRECTDRAW7;
#define LPDIRECTDRAW7 DIRECTDRAW7 *

#define DDLOCK_SURFACEMEMORYPTR 0
typedef struct
	{
		int *GetVertexBufferDesc(void *);
		int *Lock(int a, void **b, void *c);
		int *Unlock(void);
        int *Release(void);
	} DIRECT3DVERTEXBUFFER7;
#define LPDIRECT3DVERTEXBUFFER7 DIRECT3DVERTEXBUFFER7 *

typedef struct
	{
		int *Draw(void);
        int *Release(void);
		LPDIRECT3DVERTEXBUFFER7 GetVB(void);
	} ID3DXSimpleShape;
	
inline int PostMessage(HWND, int, WPARAM, LPARAM);
#define SendMessage PostMessage

HDC  GetDC(HWND);
BOOL ExtTextOut(HDC hdc,int X,int Y, int fuOptions, RECT *lprc, char *lpString, int cbCount, int *lpDx);
BOOL PtInRect(RECT *rRect, POINT pPoint);
void GetClientRect(HWND hWnd, RECT *rRect);
void CopyRect(RECT *rR1, RECT *rR2);
void InflateRect(RECT *rRect, int iX, int iY);
void SetRect(RECT *rRect, int x, int y, int w, int h);

void PostQuitMessage(int);
int DefWindowProc(int, int, WORD, LONG);
void DestroyWindow(HWND);
long GetWindowLong(int, int);
void SetWindowLong(int, int, long);
HPEN CreatePen(int, int, int);
HBRUSH CreateSolidBrush(int);
HFONT CreateFont(int, int, int, int, int, int, int, int, int, int, int, int, int, char *);
HDC CreateCompatibleDC(HDC);
HBITMAP CreateCompatibleBitmap(HDC, int, int);
int SelectObject(HDC, int);
void SetBkMode(HDC, int);
void SetTextColor(HDC, int);
void SetPixel(HDC, int, int, int);
void BeginPaint(HWND, void *);
void FillRect(HDC, RECT *, int);
void Rectangle(HDC, int, int, int, int);
void BitBlt(HDC, ...);
void ReleaseDC(HWND, HDC);
void DeleteDC(HDC);
HMENU GetSubMenu(HMENU, int);
HMENU GetMenu(HWND);
void IntersectClipRect(HDC, int, int, int, int);
void MoveToEx(HDC, int, int, int);
void LineTo(HDC, int, int);
void Ellipse(HDC, int, int, int, int);
void SelectClipRgn(HDC, int);
void ExtTextOut(HDC, int, int, int, int, char *, int, int);
void EndPaint(HWND, PAINTSTRUCT *);
BOOL PtInRect(RECT *, POINT);
void ClientToScreen(HWND, POINT *);
void ClipCursor(RECT *);
void TrackPopupMenu(HMENU, int, int, int, int, HWND, int);
void MoveWindow(HWND, int, int, int, int, int);
int GetDeviceCaps(HDC, int);
void CheckMenuItem(HMENU, int, int);
int DialogBox(HINSTANCE, LPCTSTR, HWND, void *);
int DialogBoxParam(HINSTANCE, LPCTSTR, HWND, void *, LPARAM);
void D3DXCreateBox(LPDIRECT3DDEVICE7, float, float, float, int, void *);
void D3DXCreateCylinder(LPDIRECT3DDEVICE7, float, float, float, int, int, int, void *);
void D3DXCreateTorus(LPDIRECT3DDEVICE7, float, float, int, int, int, void *);
void D3DXCreatePolygon(LPDIRECT3DDEVICE7, float, int, int, void *);
void D3DXCreateSphere(LPDIRECT3DDEVICE7, float, float, float, int, void *);
void D3DXCreateTeapot(LPDIRECT3DDEVICE7, int, void *);
void ShowWindow(HWND, int);
DWORD GetTickCount(void);
#include "d3dtypes.h"
#include <ctype.h>

#endif
