#include "kernel32.as"
#include "user32.as"

/* 以下は、VB6のAPIビューアのWIN32API.TXTから変換しました。
 * ウインドウメッセージ以外は、必要に応じて随時追加します。
 */
#define WM_NULL				0x0
#define WM_CREATE			0x1
#define WM_DESTROY			0x2
#define WM_MOVE				0x3
#define WM_SIZE				0x5
#define WM_ACTIVATE			0x6
#define WM_SETFOCUS			0x7
#define WM_KILLFOCUS			0x8
#define WM_ENABLE			0xA
#define WM_SETREDRAW			0xB
#define WM_SETTEXT			0xC
#define WM_GETTEXT			0xD
#define WM_GETTEXTLENGTH		0xE
#define WM_PAINT			0xF
#define WM_CLOSE			0x10
#define WM_QUERYENDSESSION		0x11
#define WM_QUIT				0x12
#define WM_QUERYOPEN			0x13
#define WM_ERASEBKGND			0x14
#define WM_SYSCOLORCHANGE		0x15
#define WM_ENDSESSION			0x16
#define WM_SHOWWINDOW			0x18
#define WM_WININICHANGE			0x1A
#define WM_DEVMODECHANGE		0x1B
#define WM_ACTIVATEAPP			0x1C
#define WM_FONTCHANGE			0x1D
#define WM_TIMECHANGE			0x1E
#define WM_CANCELMODE			0x1F
#define WM_SETCURSOR			0x20
#define WM_MOUSEACTIVATE		0x21
#define WM_CHILDACTIVATE		0x22
#define WM_QUEUESYNC			0x23
#define WM_GETMINMAXINFO		0x24
#define WM_PAINTICON			0x26
#define WM_ICONERASEBKGND		0x27
#define WM_NEXTDLGCTL			0x28
#define WM_SPOOLERSTATUS		0x2A
#define WM_DRAWITEM			0x2B
#define WM_MEASUREITEM			0x2C
#define WM_DELETEITEM			0x2D
#define WM_VKEYTOITEM			0x2E
#define WM_CHARTOITEM			0x2F
#define WM_SETFONT			0x30
#define WM_GETFONT			0x31
#define WM_SETHOTKEY			0x32
#define WM_GETHOTKEY			0x33
#define WM_QUERYDRAGICON		0x37
#define WM_COMPAREITEM			0x39
#define WM_COMPACTING			0x41
#define WM_OTHERWINDOWCREATED		0x42
#define WM_OTHERWINDOWDESTROYED		0x43
#define WM_COMMNOTIFY			0x44
#define WM_WINDOWPOSCHANGING		0x46
#define WM_WINDOWPOSCHANGED		0x47
#define WM_POWER			0x48
#define WM_COPYDATA			0x4A
#define WM_CANCELJOURNAL		0x4B
#define WM_NCCREATE			0x81
#define WM_NCDESTROY			0x82
#define WM_NCCALCSIZE			0x83
#define WM_NCHITTEST			0x84
#define WM_NCPAINT			0x85
#define WM_NCACTIVATE			0x86
#define WM_GETDLGCODE			0x87
#define WM_NCMOUSEMOVE			0xA0
#define WM_NCLBUTTONDOWN		0xA1
#define WM_NCLBUTTONUP			0xA2
#define WM_NCLBUTTONDBLCLK		0xA3
#define WM_NCRBUTTONDOWN		0xA4
#define WM_NCRBUTTONUP			0xA5
#define WM_NCRBUTTONDBLCLK		0xA6
#define WM_NCMBUTTONDOWN		0xA7
#define WM_NCMBUTTONUP			0xA8
#define WM_NCMBUTTONDBLCLK		0xA9
#define WM_KEYFIRST			0x100
#define WM_KEYDOWN			0x100
#define WM_KEYUP			0x101
#define WM_CHAR				0x102
#define WM_DEADCHAR			0x103
#define WM_SYSKEYDOWN			0x104
#define WM_SYSKEYUP			0x105
#define WM_SYSCHAR			0x106
#define WM_SYSDEADCHAR			0x107
#define WM_KEYLAST			0x108
#define WM_INITDIALOG			0x110
#define WM_COMMAND			0x111
#define WM_SYSCOMMAND			0x112
#define WM_TIMER			0x113
#define WM_HSCROLL			0x114
#define WM_VSCROLL			0x115
#define WM_INITMENU			0x116
#define WM_INITMENUPOPUP		0x117
#define WM_MENUSELECT			0x11F
#define WM_MENUCHAR			0x120
#define WM_ENTERIDLE			0x121
#define WM_CTLCOLORMSGBOX		0x132
#define WM_CTLCOLOREDIT			0x133
#define WM_CTLCOLORLISTBOX		0x134
#define WM_CTLCOLORBTN			0x135
#define WM_CTLCOLORDLG			0x136
#define WM_CTLCOLORSCROLLBAR		0x137
#define WM_CTLCOLORSTATIC		0x138
#define WM_MOUSEFIRST			0x200
#define WM_MOUSEMOVE			0x200
#define WM_LBUTTONDOWN			0x201
#define WM_LBUTTONUP			0x202
#define WM_LBUTTONDBLCLK		0x203
#define WM_RBUTTONDOWN			0x204
#define WM_RBUTTONUP			0x205
#define WM_RBUTTONDBLCLK		0x206
#define WM_MBUTTONDOWN			0x207
#define WM_MBUTTONUP			0x208
#define WM_MBUTTONDBLCLK		0x209
#define WM_MOUSELAST			0x209
#define WM_PARENTNOTIFY			0x210
#define WM_ENTERMENULOOP		0x211
#define WM_EXITMENULOOP			0x212
#define WM_MDICREATE			0x220
#define WM_MDIDESTROY			0x221
#define WM_MDIACTIVATE			0x222
#define WM_MDIRESTORE			0x223
#define WM_MDINEXT			0x224
#define WM_MDIMAXIMIZE			0x225
#define WM_MDITILE			0x226
#define WM_MDICASCADE			0x227
#define WM_MDIICONARRANGE		0x228
#define WM_MDIGETACTIVE			0x229
#define WM_MDISETMENU			0x230
#define WM_DROPFILES			0x233
#define WM_MDIREFRESHMENU		0x234
#define WM_CUT				0x300
#define WM_COPY				0x301
#define WM_PASTE			0x302
#define WM_CLEAR			0x303
#define WM_UNDO				0x304
#define WM_RENDERFORMAT			0x305
#define WM_RENDERALLFORMATS		0x306
#define WM_DESTROYCLIPBOARD		0x307
#define WM_DRAWCLIPBOARD		0x308
#define WM_PAINTCLIPBOARD		0x309
#define WM_VSCROLLCLIPBOARD		0x30A
#define WM_SIZECLIPBOARD		0x30B
#define WM_ASKCBFORMATNAME		0x30C
#define WM_CHANGECBCHAIN		0x30D
#define WM_HSCROLLCLIPBOARD		0x30E
#define WM_QUERYNEWPALETTE		0x30F
#define WM_PALETTEISCHANGING		0x310
#define WM_PALETTECHANGED		0x311
#define WM_HOTKEY			0x312
#define WM_PENWINFIRST			0x380
#define WM_PENWINLAST			0x38F
#define WM_USER				0x400
#define WM_DDE_FIRST			0x3E0
#define WM_DDE_INITIATE			(WM_DDE_FIRST)
#define WM_DDE_TERMINATE		(WM_DDE_FIRST+1)
#define WM_DDE_ADVISE			(WM_DDE_FIRST+2)
#define WM_DDE_UNADVISE			(WM_DDE_FIRST+3)
#define WM_DDE_ACK			(WM_DDE_FIRST+4)
#define WM_DDE_DATA			(WM_DDE_FIRST+5)
#define WM_DDE_REQUEST			(WM_DDE_FIRST+6)
#define WM_DDE_POKE			(WM_DDE_FIRST+7)
#define WM_DDE_EXECUTE			(WM_DDE_FIRST+8)
#define WM_DDE_LAST			(WM_DDE_FIRST+8)
#define WM_CONVERTREQUESTEX		0x108
#define WM_IME_STARTCOMPOSITION		0x10D
#define WM_IME_ENDCOMPOSITION		0x10E
#define WM_IME_COMPOSITION		0x10F
#define WM_IME_KEYLAST			0x10F
#define WM_IME_SETCONTEXT		0x281
#define WM_IME_NOTIFY			0x282
#define WM_IME_CONTROL			0x283
#define WM_IME_COMPOSITIONFULL		0x284
#define WM_IME_SELECT			0x285
#define WM_IME_CHAR			0x286
#define WM_IME_KEYDOWN			0x290
#define WM_IME_KEYUP			0x291
#define WM_CHOOSEFONT_GETLOGFONT	(WM_USER+1)
#define WM_CHOOSEFONT_SETLOGFONT	(WM_USER+101)
#define WM_CHOOSEFONT_SETFLAGS		(WM_USER+102)
#define WM_PSD_PAGESETUPDLG		(WM_USER)
#define WM_PSD_FULLPAGERECT		(WM_USER+1)
#define WM_PSD_MINMARGINRECT		(WM_USER+2)
#define WM_PSD_MARGINRECT		(WM_USER+3)
#define WM_PSD_GREEKTEXTRECT		(WM_USER+4)
#define WM_PSD_ENVSTAMPRECT		(WM_USER+5)
#define WM_PSD_YAFULLPAGERECT		(WM_USER+6)

/* Menu flags for Add/Check/EnableMenuItem() */
#define MF_INSERT			0x0
#define MF_CHANGE			0x80
#define MF_APPEND			0x100
#define MF_DELETE			0x200
#define MF_REMOVE			0x1000
#define MF_BYCOMMAND			0x0
#define MF_BYPOSITION			0x400
#define MF_SEPARATOR			0x800
#define MF_ENABLED			0x0
#define MF_GRAYED			0x1
#define MF_DISABLED			0x2
#define MF_UNCHECKED			0x0
#define MF_CHECKED			0x8
#define MF_USECHECKBITMAPS		0x200
#define MF_STRING			0x0
#define MF_BITMAP			0x4
#define MF_OWNERDRAW			0x100
#define MF_POPUP			0x10
#define MF_MENUBARBREAK			0x20
#define MF_MENUBREAK			0x40
#define MF_UNHILITE			0x0
#define MF_HILITE			0x80
#define MF_SYSMENU			0x2000
#define MF_HELP				0x4000
#define MF_MOUSESELECT			0x8000

/* Key State Masks for Mouse Messages */
#define MK_LBUTTON			0x1
#define MK_RBUTTON			0x2
#define MK_SHIFT			0x4
#define MK_CONTROL			0x8
#define MK_MBUTTON			0x10
