#ifndef _WINUSER_
#define _WINUSER_


#ifndef RC_INVOKED
#include <stdarg.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif
#include <Wine/pshpack2.h>
#include <Wine/poppack.h>

#define MB_ICONASTERISK		0x00000040
#define MB_OK			0x00000000
#define MB_ICONINFORMATION	MB_ICONASTERISK
#define VK_CAPITAL          0x14
#define VK_SHIFT            0x10
#define VK_CONTROL          0x11
#define CS_HREDRAW          0x00000002
#define VK_MENU             0x12
#define SM_CYCAPTION	       4
#define CS_VREDRAW          0x00000001
#define MAKEINTRESOURCEA(i) (LPSTR)((ULONG_PTR)((WORD)(i)))
#define WM_INITMENU         0x0116
#define SM_CXFRAME	      32
#define SWP_SHOWWINDOW      0x0040
#define WM_COMMAND          0x0111
#define IDC_ARROW          MAKEINTRESOURCE(32512)
#define WM_MDIICONARRANGE   0x0228
#define WM_MDIDESTROY	    0x0221
#define WM_INITDIALOG       0x0110
#define WM_CLOSE                0x0010
#define COLOR_WINDOW		    5
#define SW_SHOW             5
#define IMAGE_ICON	1
#define MB_APPLMODAL		0x00000000
#define WM_CREATE               0x0001
#define WS_HSCROLL       0x00100000L
#define WM_ACTIVATE             0x0006
#define MB_SETFOREGROUND	0x00010000
#define WM_WINDOWPOSCHANGED 	0x0047
#define WM_DESTROY              0x0002
#define SWP_NOSIZE          0x0001
#define WM_MDIGETACTIVE     0x0229
#define WM_MDITILE	    0x0226
#define WM_MDICASCADE	    0x0227
#define WM_USER             0x0400
#define IDOK                1
#define SWP_NOZORDER        0x0004
#define GWL_STYLE           (-16)
#define CW_USEDEFAULT ((INT)0x80000000)
#define WS_EX_MDICHILD         0x00000040L
#define WS_MAXIMIZEBOX   0x00010000L
#define WM_MOUSEMOVE	    0x0200
#define WM_WINDOWPOSCHANGING 	0x0046
#define MB_YESNOCANCEL		0x00000003
# define GWL_USERDATA        (-21)
#define MB_ICONEXCLAMATION	0x00000030
#define WM_GETMINMAXINFO        0x0024
#define WM_MDIACTIVATE	    0x0222
#define SIZE_MINIMIZED       1
#define WM_SIZE                 0x0005
#define WM_LBUTTONDOWN	    0x0201
#define WM_CHAR             0x0102
#define WM_PAINT                0x000f
#define WS_CLIPCHILDREN  0x02000000L
#define WS_OVERLAPPED    0x00000000L
#define WS_CAPTION       0x00C00000L
#define WS_SYSMENU       0x00080000L
#define WS_THICKFRAME    0x00040000L
#define WS_MINIMIZEBOX   0x00020000L
#define WS_MAXIMIZEBOX   0x00010000L
#define WS_CHILD         0x40000000L
#define WS_VSCROLL       0x00200000L

#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME| WS_MINIMIZEBOX | WS_MAXIMIZEBOX)

#ifdef __WINESRC__
/* force using a cast when inside Wine */
#define MAKEINTRESOURCE(i) ((ULONG_PTR)((WORD)(i)))
#else
#define MAKEINTRESOURCE WINELIB_NAME_AW(MAKEINTRESOURCE)
#endif

#define     CreateWindowA(className,titleName,style,x,y,width,height,\
                            parent,menu,instance,param) \
            CreateWindowExA(0,className,titleName,style,x,y,width,height,\
                              parent,menu,instance,param)


#define     LoadIcon WINELIB_NAME_AW(LoadIcon)
#define     MessageBox WINELIB_NAME_AW(MessageBox)
#define     LoadString WINELIB_NAME_AW(LoadString)
#define     DispatchMessage WINELIB_NAME_AW(DispatchMessage)
#define     DefFrameProc WINELIB_NAME_AW(DefFrameProc)
#define     GetWindowText WINELIB_NAME_AW(GetWindowText)
#define     wsprintf WINELIB_NAME_AW(wsprintf)
#define     DialogBox WINELIB_NAME_AW(DialogBox)
#define     LoadAccelerators WINELIB_NAME_AW(LoadAccelerators)
#define     SendMessage WINELIB_NAME_AW(SendMessage)
#define     SetWindowLong WINELIB_NAME_AW(SetWindowLong)
#define     DefMDIChildProc WINELIB_NAME_AW(DefMDIChildProc)
#define     LoadCursor WINELIB_NAME_AW(LoadCursor)
#define     LoadImage WINELIB_NAME_AW(LoadImage)
#define     GetMessage WINELIB_NAME_AW(GetMessage)
#define     DialogBoxA(inst,template,owner,func) \
            DialogBoxParamA(inst,template,owner,func,0)
#define     RegisterClassEx WINELIB_NAME_AW(RegisterClassEx)
#define     RegisterClass WINELIB_NAME_AW(RegisterClass)
#define     GetWindowLong WINELIB_NAME_AW(GetWindowLong)
#define     CreateWindow WINELIB_NAME_AW(CreateWindow)
#define     TranslateAccelerator WINELIB_NAME_AW(TranslateAccelerator)
#define     CreateWindowEx WINELIB_NAME_AW(CreateWindowEx)

typedef struct tagMINMAXINFO
{
    POINT   ptReserved;
    POINT   ptMaxSize;
    POINT   ptMaxPosition;
    POINT   ptMinTrackSize;
    POINT   ptMaxTrackSize;
} MINMAXINFO;
typedef MINMAXINFO *LPMINMAXINFO;

typedef struct tagMSG
{
    HWND    hwnd;
    UINT    message;
    WPARAM  wParam;
    LPARAM    lParam;
    DWORD     time;
    POINT   pt;
} MSG;
typedef MSG  *LPMSG;

typedef struct tagPAINTSTRUCT
{
    HDC   hdc;
    BOOL  fErase;
    RECT  rcPaint;
    BOOL  fRestore;
    BOOL  fIncUpdate;
    BYTE  rgbReserved[32];
} PAINTSTRUCT;
typedef  PAINTSTRUCT  *LPPAINTSTRUCT;

typedef LRESULT (CALLBACK *WNDPROC)(HWND,UINT,WPARAM,LPARAM);

typedef struct tagWNDCLASSEXA
{
    UINT      cbSize;
    UINT      style;
    WNDPROC   lpfnWndProc;
    INT       cbClsExtra;
    INT       cbWndExtra;
    HINSTANCE hInstance;
    HICON     hIcon;
    HCURSOR   hCursor;
    HBRUSH    hbrBackground;
    LPCSTR      lpszMenuName;
    LPCSTR      lpszClassName;
    HICON     hIconSm;
} WNDCLASSEXA;

typedef struct tagWNDCLASSA
{
    UINT      style;
    WNDPROC   lpfnWndProc;
    INT       cbClsExtra;
    INT       cbWndExtra;
    HINSTANCE hInstance;
    HICON     hIcon;
    HCURSOR   hCursor;
    HBRUSH    hbrBackground;
    LPCSTR      lpszMenuName;
    LPCSTR      lpszClassName;
} WNDCLASSA ;
typedef WNDCLASSA *LPWNDCLASSA;

DECL_WINELIB_TYPE_AW(WNDCLASSEX)
DECL_WINELIB_TYPE_AW(LPWNDCLASS)

typedef INT_PTR (CALLBACK *DLGPROC)(HWND,UINT,WPARAM,LPARAM);

typedef struct tagCLIENTCREATESTRUCT
{
    HMENU   hWindowMenu;
    UINT    idFirstChild;
} CLIENTCREATESTRUCT;

typedef struct tagWINDOWPOS
{
    HWND  hwnd;
    HWND  hwndInsertAfter;
    INT   x;
    INT   y;
    INT   cx;
    INT   cy;
    UINT  flags;
} WINDOWPOS;


//func

INT         WINAPI MessageBoxA(HWND,LPCSTR,LPCSTR,UINT);
INT       WINAPI FillRect(HDC,const RECT*,HBRUSH);
INT       WINAPI GetSystemMetrics(INT);
HWND      WINAPI GetParent(HWND);
HICON     WINAPI LoadIconA(HINSTANCE,LPCSTR);
HMENU     WINAPI GetSubMenu(HMENU,INT);
LRESULT     WINAPI DispatchMessageA(const MSG*);
void        WINAPI PostQuitMessage(INT);
BOOL      WINAPI SetWindowPos(HWND,HWND,INT,INT,INT,INT,UINT);
BOOL        WINAPI GetKeyboardState(LPBYTE);
BOOL        WINAPI EndDialog(HWND,INT_PTR);
HWND        WINAPI GetDesktopWindow(void);
BOOL        WINAPI UpdateWindow(HWND);
INT       WINAPI LoadStringA(HINSTANCE,UINT,LPSTR,INT);
HACCEL    WINAPI LoadAcceleratorsA(HINSTANCE,LPCSTR);
BOOL        WINAPI TranslateMessage(const MSG*);
BOOL      WINAPI IsWindow(HWND);
BOOL        WINAPI GetWindowRect(HWND,LPRECT);
INT         WINAPI GetWindowTextA(HWND,LPSTR,INT);
BOOL        WINAPI EndPaint(HWND,const PAINTSTRUCT*);
LONG        WINAPI SetWindowLongA(HWND,INT,LONG);
HDC         WINAPI BeginPaint(HWND,LPPAINTSTRUCT);
LRESULT     WINAPI DefMDIChildProcA(HWND,UINT,WPARAM,LPARAM);
HCURSOR   WINAPI LoadCursorA(HINSTANCE,LPCSTR);
LRESULT     WINAPI SendMessageA(HWND,UINT,WPARAM,LPARAM);
INT       WINAPIV wsprintfA(LPSTR,LPCSTR,...);
HWND      WINAPI SetFocus(HWND);
HANDLE    WINAPI LoadImageA(HINSTANCE,LPCSTR,UINT,INT,INT,UINT);
 #ifndef __MACWINDOWS__
BOOL      WINAPI ShowWindow(HWND,INT);
#endif
BOOL      WINAPI GetMessageA(LPMSG,HWND,UINT,UINT);
LONG        WINAPI GetMessageTime(void);
INT_PTR   WINAPI DialogBoxParamA(HINSTANCE,LPCSTR,HWND,DLGPROC,LPARAM);
ATOM        WINAPI RegisterClassExA(const WNDCLASSEXA *);
ATOM        WINAPI RegisterClassA(const WNDCLASSA *);
LONG        WINAPI GetWindowLongA(HWND,INT);
BOOL        WINAPI TranslateMDISysAccel(HWND,LPMSG);
DWORD       WINAPI GetMessagePos(void);
INT         WINAPI TranslateAcceleratorA(HWND,HACCEL,LPMSG);
LRESULT     WINAPI DefFrameProcA(HWND,HWND,UINT,WPARAM,LPARAM);
BOOL      WINAPI IsIconic(HWND);
HWND      WINAPI CreateWindowExA(DWORD,LPCSTR,LPCSTR,DWORD,INT,INT,
                                INT,INT,HWND,HMENU,HINSTANCE,LPVOID);

#ifdef __cplusplus
}
#endif

#endif /* _WINUSER_ */

